mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
RFC: https://wiki.php.net/rfc/deprecate-implicitly-nullable-types Co-authored-by: Gina Peter Banyard <girgias@php.net>
22 lines
294 B
PHP
22 lines
294 B
PHP
--TEST--
|
|
Testing parameter type-hinted with default value inside namespace
|
|
--FILE--
|
|
<?php
|
|
|
|
namespace foo;
|
|
|
|
class bar {
|
|
public function __construct(?\stdclass $x = NULL) {
|
|
var_dump($x);
|
|
}
|
|
}
|
|
|
|
new bar(new \stdclass);
|
|
new bar(null);
|
|
|
|
?>
|
|
--EXPECTF--
|
|
object(stdClass)#%d (0) {
|
|
}
|
|
NULL
|