go to bug id or search bugs for
I have an extension class that implements cast_object and is castable to IS_STRING, IS_LONG, IS_DOUBLE, _IS_BOOL, and _IS_NUMBER (Thanks nikic). I was just testing it out and tried to throw an instance of this class to microtime() and
- the following warning was generated: "microtime() expects parameter 1 to be bool, object given"
- microtime returned null which it's not documented to do.
I traced the code path down to zend_parse_arg_bool_weak and noticed that it doesn't do anything for zend types > IS_STRING. Shouldn't an IS_OBJECT be given a chance at cast_object?
// Replace IaNumber with any PHP Extension class that can cast_object to _IS_BOOL
$n = new IaNumber("0");
$a = microtime($n);
Add a Patch
Add a Pull Request