php-src/tests/classes/property_override_private_publicStatic.phpt

35 lines
457 B
Plaintext
Raw Permalink Normal View History

--TEST--
Redeclare inherited private property as public static.
--FILE--
<?php
class A
{
private $p = "A::p";
function showA()
{
echo $this->p . "\n";
}
}
2018-09-16 17:16:42 +00:00
class B extends A
{
public static $p = "B::p (static)";
static function showB()
{
echo self::$p . "\n";
}
}
2018-09-16 17:16:42 +00:00
$a = new A;
$a->showA();
2018-09-16 17:16:42 +00:00
$b = new B;
$b->showA();
B::showB();
?>
--EXPECT--
A::p
A::p
B::p (static)