On Fri, Dec 8, 2017 at 11:35 PM, Kalle Sommer Nielsen <[email protected]> wrote:
> We should just add a warning to the first example, it seems like an
> oversight that it was left silent
I strongly object! We ought to consider using `instanceof` to support
more type-checks than just classes. I think `1 instanceof int` really
ought to return true for both literals and if they were variables:
$lhs = 1;
$rhs = 'int';
var_export($lhs instanceof $rhs);
The fact we do not have a single, unified way to check if some value
on the LHS is of the type on the RHS really bothers me.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php