From: tims at arizona dot edu Operating system: Debian Linux PHP version: 5.2.1 PHP Bug Type: Scripting Engine problem Bug description: boolean argument type to function throws Catchable fatal error.
Description: ------------ I have found a minimal reproducible test case that consistently fails. I believe this should work as a typed parameter but php5 dies with the result below. Reproduce code: --------------- $b = true; function f( boolean $a ) { return $a; } f( $b ); Expected result: ---------------- The above code does not do much except return the boolean that was passed in. My larger block of code uses typed arguments to ensure the type of data being passed in. The bool type does not work and I can not find a suitable workaround. Actual result: -------------- Catchable fatal error: Argument 1 passed to f() must be an instance of boolean, boolean given, called in /home/bink/Projects/opticsnow/web_software/dev_space/a.php on line 5 and defined in /home/bink/Projects/opticsnow/web_software/dev_space/a.php on line 4 -- Edit bug report at http://bugs.php.net/?id=40782&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40782&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40782&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40782&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=40782&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=40782&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=40782&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=40782&r=needscript Try newer version: http://bugs.php.net/fix.php?id=40782&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=40782&r=support Expected behavior: http://bugs.php.net/fix.php?id=40782&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=40782&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=40782&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=40782&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40782&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=40782&r=dst IIS Stability: http://bugs.php.net/fix.php?id=40782&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=40782&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=40782&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=40782&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=40782&r=mysqlcfg