dis-bench / src /php /php-src /Zend /tests /constexpr /new_static.phpt
meddyrat's picture
Replace repository contents with the original corrected artifact
1e94262
Raw History Blame Contribute Delete
288 Bytes
--TEST--
Static in new is supported
--FILE--
<?php
class Foo {
public static function singleton() {
static $x = new static;
return $x;
}
}
$x = Foo::singleton();
$y = Foo::singleton();
var_dump($x, $y);
?>
--EXPECT--
object(Foo)#1 (0) {
}
object(Foo)#1 (0) {
}