|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-09-27 15:03 UTC] cmb@php.net
-Summary: Z_PARAM_BOOL doesn't invoke cast_object
+Summary: Z_PARAM_BOOL should invoke cast_object
-Type: Bug
+Type: Feature/Change Request
[2021-09-27 15:03 UTC] cmb@php.net
[2021-09-27 15:03 UTC] cmb@php.net
-Package: Unknown/Other Function
+Package: Scripting Engine problem
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 14:00:01 2025 UTC |
Description: ------------ 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? Test script: --------------- <?php // Replace IaNumber with any PHP Extension class that can cast_object to _IS_BOOL $n = new IaNumber("0"); $a = microtime($n);