From:             davojan at mail dot ru
Operating system: FreeBSD 4.7-RELEASE
PHP version:      5CVS-2004-06-09 (dev)
PHP Bug Type:     Zend Engine 2 problem
Bug description:  NULL can't be passed to argument with class type hint.

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 bug report at http://bugs.php.net/?id=28712&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28712&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28712&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=28712&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=28712&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=28712&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=28712&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=28712&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=28712&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=28712&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=28712&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=28712&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=28712&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28712&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=28712&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=28712&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=28712&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28712&r=float

Reply via email to