ID:               28712
 User updated by:  davojan at mail dot ru
 Reported By:      davojan at mail dot ru
 Status:           Open
 Bug Type:         Zend Engine 2 problem
 Operating System: FreeBSD 4.7-RELEASE
-PHP Version:      5CVS-2004-06-09 (dev)
+PHP Version:      PHP5-RC3
 New Comment:

The compromise can be to add new configuration parameter, something
like "allow_type_hinted_pass_null", to enable or disable this feature.


Previous Comments:
------------------------------------------------------------------------

[2004-06-09 19:02:58] davojan at mail dot ru

Description:
------------
Actually it was tested in RC3 (I don't find it in PHP version list).
It's very inconveniently, if I can't pass NULL instead of object to the
function.
In the example below the default value is used, but there is a same
behaviour, when I pass NULL explicitly.
I understand, that the report:
http://bugs.php.net/bug.php?id=26780&edit=2
intersects with my, but my opinion is that not accepting NULLs is an
evident bug, very serious bug! And my example with the default value
illustrates it very well.

Reproduce code:
---------------
<?
        class foo {};
        function bar (foo $f = NULL) { echo 'ok'; }
        bar();
?>

Expected result:
----------------
ok

Actual result:
--------------
Fatal error: Argument 1 must not be null in
/usr/local/www/data-dist/ils/admin/test/null.php on line 3


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=28712&edit=1

Reply via email to