Re: Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c php-src NEWS
| From: | Derick Rethans | Date: | Sun, 16 Oct 2005 21:27:51 +0000 |
| Subject: | Re: Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c php-src NEWS | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-19653@lists.php.net to get a copy of this message | ||
On Sun, 16 Oct 2005, Sebastian Bergmann wrote:
> Andi Gutmans schrieb:
> > I'm talking about the following function decleration:
> >
> > function testNull(MyClass $obj = 1) {
> > }
>
> The following should work, too, to allow optional, type-hinted Array
> parameters:
>
> function someMethod(Array $array = array()) {
> }
That seems to work fine already:
derick@kossu:/dat/dev/php/php-6.0dev$ cat /tmp/test.php
<?php
class P { }
class T {
function f(array $p = array()) {
var_dump($p);
}
}
$o=new T();
$o->f();
?>
derick@kossu:/dat/dev/php/php-6.0dev$ sapi/cli/php
-derror_reporting=8191 /tmp/test.php
array(0) {
}
regards,
Derick
--
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org