RE: [PHP-DEV] Type Hints with Null

From: Date: Fri, 07 Oct 2005 20:36:45 +0000
Subject: RE: [PHP-DEV] Type Hints with Null
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-19484@lists.php.net to get a copy of this message
Lovely. - David > -----Original Message----- > From: Derick Rethans [mailto:derick@php.net] > Sent: Friday, October 07, 2005 10:30 PM > To: PHP Developers Mailing List > Subject: [PHP-DEV] Type Hints with Null > > Hello, > > attached is a patch (by Markus) that allows you to make typehints > optionally take NULL as default value too, f.e.: > > class P { } > class T { > function f(P $p = NULL) { > var_dump($p); > } > } > > $o=new T(); > $o->f(new P); > $o->f(NULL); > $o->f(); > > I would like to commit this patch to HEAD pending any objections. > > regards, > Derick > > -- > Derick Rethans > http://derickrethans.nl | > http://ez.no | http://xdebug.org

« previous php.internals (#19484) next »