mirror of
https://github.com/php/php-src.git
synced 2024-12-19 15:00:15 +08:00
ded3d984c6
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
25 lines
424 B
PHP
25 lines
424 B
PHP
--TEST--
|
|
ZE2 Late Static Binding creating a new class with 'static'
|
|
--FILE--
|
|
<?php
|
|
|
|
class TestClass {
|
|
public static function createInstance() {
|
|
return new static();
|
|
}
|
|
}
|
|
|
|
class ChildClass extends TestClass {}
|
|
|
|
$testClass = TestClass::createInstance();
|
|
$childClass = ChildClass::createInstance();
|
|
|
|
echo get_class($testClass) . "\n";
|
|
echo get_class($childClass) . "\n";
|
|
?>
|
|
==DONE==
|
|
--EXPECT--
|
|
TestClass
|
|
ChildClass
|
|
==DONE==
|