php-src/Zend/tests/ns_071.phpt
2010-05-20 19:18:35 +00:00

22 lines
419 B
PHP

--TEST--
Testing parameter type-hinted (array) with default value inside namespace
--FILE--
<?php
namespace foo;
class bar {
public function __construct(array $x = NULL) {
var_dump($x);
}
}
new bar(null);
new bar(new \stdclass);
?>
--EXPECTF--
NULL
Catchable fatal error: Argument 1 passed to foo\bar::__construct() must be of the type array, object given, called in %s on line %d and defined in %s on line %d