2008-11-10 19:39:35 +08:00
--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);
2008-12-05 04:12:30 +08:00
new bar(new \stdclass);
2008-11-10 19:39:35 +08:00
?>
--EXPECTF--
NULL
2015-05-18 06:31:43 +08:00
Fatal error: Uncaught TypeError: 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:%d
2015-05-18 00:59:34 +08:00
Stack trace:
2015-05-18 03:49:53 +08:00
#0 %s(%d): foo\bar->__construct(Object(stdClass))
2015-05-18 00:59:34 +08:00
#1 {main}
thrown in %s on line %d