2008-11-10 11:39:35 +00: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-04 20:12:30 +00:00
new bar(new \stdclass);
2008-11-10 11:39:35 +00:00
?>
--EXPECTF--
NULL
2016-08-08 15:15:59 +00:00
Fatal error: Uncaught TypeError: Argument 1 passed to foo\bar::__construct() must be of the type array or null, object given, called in %s on line %d and defined in %s:%d
2015-05-17 16:59:34 +00:00
Stack trace:
2015-05-17 19:49:53 +00:00
#0 %s(%d): foo\bar->__construct(Object(stdClass))
2015-05-17 16:59:34 +00:00
#1 {main}
thrown in %s on line %d