mirror of
https://github.com/php/php-src.git
synced 2026-03-25 16:52:18 +01:00
23 lines
292 B
PHP
23 lines
292 B
PHP
--TEST--
|
|
Static in new is not 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) {
|
|
}
|