From:             nospam0 at malkusch dot de
Operating system: Linux
PHP version:      5.0.0RC3
PHP Bug Type:     Feature/Change Request
Bug description:  class type hints for function parameters to not allow the passing of 
NULL

Description:
------------
Since RC3 I can't define optional parameters when I'm 
using type hinting. Why is it no more allowed to use NULL. 
Im used to do so from other OO Languages. 
 
So if I have to live with no NULL and want to use class 
Type hints, how can I use optional Paramters? 

Reproduce code:
---------------
class Test {

        public function test(Test $optinalTest = null) {
        }

}

Expected result:
----------------
No Error, or a possibility to use class type hints *and* 
optinal parameters. Perfect would be the old behavoir, 
that I'm allowed to use NULL. 

Actual result:
--------------
Fatal error: Argument 1 must not be null 

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

Reply via email to