ns_071.phpt 419 B

123456789101112131415161718192021
  1. --TEST--
  2. Testing parameter type-hinted (array) with default value inside namespace
  3. --FILE--
  4. <?php
  5. namespace foo;
  6. class bar {
  7. public function __construct(array $x = NULL) {
  8. var_dump($x);
  9. }
  10. }
  11. new bar(null);
  12. new bar(new \stdclass);
  13. ?>
  14. --EXPECTF--
  15. NULL
  16. 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