How can I tell if a variable is of type enum?
I have installed PHP 8.1 on my Ubuntu 20.04. I'm testing the new "enum" types.
Is something like that possible?
is_enum($var)
gettype($var) === 'enum'
Someone told me the solution:
if ($var instanceof \UnitEnum) {
echo 'is enum';
}