mirror of
https://github.com/php/php-src.git
synced 2024-12-17 22:09:12 +08:00
a555cc0b3d
Remove most of the `===DONE===` tags and its variations. Keep `===DONE===` if the test output otherwise becomes empty. Closes GH-4872.
64 lines
982 B
PHP
64 lines
982 B
PHP
--TEST--
|
|
Bug #28442 (Changing a static variables in a class changes it across sub/super classes.)
|
|
--FILE--
|
|
<?php
|
|
|
|
class ClassA
|
|
{
|
|
static $prop;
|
|
}
|
|
|
|
class ClassB extends ClassA
|
|
{
|
|
static $prop;
|
|
}
|
|
|
|
class ClassC extends ClassB
|
|
{
|
|
}
|
|
|
|
echo "===INIT===\n";
|
|
ClassA::$prop = 'A';
|
|
ClassB::$prop = 'B';
|
|
ClassC::$prop = 'C';
|
|
var_dump(ClassA::$prop);
|
|
var_dump(ClassB::$prop);
|
|
var_dump(ClassC::$prop);
|
|
|
|
echo "===SetA===\n";
|
|
ClassA::$prop = 'A2';
|
|
var_dump(ClassA::$prop);
|
|
var_dump(ClassB::$prop);
|
|
var_dump(ClassC::$prop);
|
|
|
|
echo "===SetB===\n";
|
|
ClassB::$prop = 'B2';
|
|
var_dump(ClassA::$prop);
|
|
var_dump(ClassB::$prop);
|
|
var_dump(ClassC::$prop);
|
|
|
|
echo "===SetC===\n";
|
|
ClassC::$prop = 'C2';
|
|
var_dump(ClassA::$prop);
|
|
var_dump(ClassB::$prop);
|
|
var_dump(ClassC::$prop);
|
|
|
|
?>
|
|
--EXPECT--
|
|
===INIT===
|
|
string(1) "A"
|
|
string(1) "C"
|
|
string(1) "C"
|
|
===SetA===
|
|
string(2) "A2"
|
|
string(1) "C"
|
|
string(1) "C"
|
|
===SetB===
|
|
string(2) "A2"
|
|
string(2) "B2"
|
|
string(2) "B2"
|
|
===SetC===
|
|
string(2) "A2"
|
|
string(2) "C2"
|
|
string(2) "C2"
|