ID: 33325 Updated by: [EMAIL PROTECTED] Reported By: jacob at jacobweber dot com -Status: Open +Status: Bogus Bug Type: Class/Object related Operating System: All PHP Version: 5.0.4 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php This is intended behaviour. Previous Comments: ------------------------------------------------------------------------ [2005-06-13 19:17:22] jacob at jacobweber dot com Description: ------------ When using type-hinting in a function's arguments, PHP should allow a default value of NULL. Otherwise you have to manaully check the type with instanceof. This would make it more convenient, and more consistent with Java. Reproduce code: --------------- function f (MyClass $o = NULL) { echo "success"; } f(); Expected result: ---------------- success Actual result: -------------- PHP compiler error. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33325&edit=1