Ticket #208 (closed defect: fixed)
null as default value for parameters with array type hint produces a fatal error
| Reported by: | romain.lalaut@… | Owned by: | moo |
|---|---|---|---|
| Priority: | critical | Milestone: | 1.3.0 |
| Component: | cacher | Version: | 2.0.0 |
| Keywords: | null hint | Cc: | |
| Blocked By: | PHP Version: | 5.3.0RC2-dev | |
| Application: | Need User Feedback: | no | |
| Other Exts: | SAPI: | FastCGI | |
| Probability: | Always | Blocking: | 129 |
Description (last modified by moo) (diff)
To reproduce the error :
test.php
<?php
class A
{
public function __construct( array $a = NULL)
{
echo 'Fooo';
}
}
new A();
test2.php
<?php
namespace My\NS;
use My\NS;
class A
{
public function __construct( array $a = NULL)
{
echo 'Fooo';
}
}
new A();
Actually it returns
$ php-cgi test.php X-Powered-By: PHP/5.3.0alpha4-dev Content-type: text/html <br /> <b>Fatal error</b>: Default value for parameters with array type hint can only be an array or NULL in <b>/home/romain/aubonticket/dev/tmp/bug.php</b> on line <b>5</b><br />
It must be (and it works with CLI SAPI) :
$ php-cgi test.php Fooo
Attachments
Change History
Note: See
TracTickets for help on using
tickets.


