mirror of
https://github.com/php/php-src.git
synced 2024-12-15 04:45:03 +08:00
52 lines
723 B
Plaintext
52 lines
723 B
Plaintext
|
--TEST--
|
||
|
ZE2 Late Static Binding stacking static calleds
|
||
|
--FILE--
|
||
|
<?php
|
||
|
|
||
|
class TestA {
|
||
|
public static function test() {
|
||
|
echo get_class(new static()) . "\n";
|
||
|
TestB::test();
|
||
|
echo get_class(new static()) . "\n";
|
||
|
TestC::test();
|
||
|
echo get_class(new static()) . "\n";
|
||
|
TestBB::test();
|
||
|
echo get_class(new static()) . "\n";
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class TestB {
|
||
|
public static function test() {
|
||
|
echo get_class(new static()) . "\n";
|
||
|
TestC::test();
|
||
|
echo get_class(new static()) . "\n";
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class TestC {
|
||
|
public static function test() {
|
||
|
echo get_class(new static()) . "\n";
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class TestBB extends TestB {
|
||
|
}
|
||
|
|
||
|
TestA::test();
|
||
|
|
||
|
?>
|
||
|
==DONE==
|
||
|
--EXPECTF--
|
||
|
TestA
|
||
|
TestB
|
||
|
TestC
|
||
|
TestB
|
||
|
TestA
|
||
|
TestC
|
||
|
TestA
|
||
|
TestBB
|
||
|
TestC
|
||
|
TestBB
|
||
|
TestA
|
||
|
==DONE==
|