mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
While reviewing the existing tests in the `constexpr` directory, I found that some of the names were not updated to reflect the contents when the contents were changed in #9301. Follow-up to #15638
23 lines
288 B
PHP
23 lines
288 B
PHP
--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) {
|
|
}
|