1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 07:28:09 +02:00
Files
archived-php-src/tests/classes/property_override_protected_protected.phpt
T
2018-10-14 12:07:20 -03:00

35 lines
429 B
PHP

--TEST--
Redeclare inherited protected property as protected.
--FILE--
<?php
class A
{
protected $p = "A::p";
function showA()
{
echo $this->p . "\n";
}
}
class B extends A
{
protected $p = "B::p";
function showB()
{
echo $this->p . "\n";
}
}
$a = new A;
$a->showA();
$b = new B;
$b->showA();
$b->showB();
?>
--EXPECT--
A::p
B::p
B::p