2008-01-30 14:25:57 +00:00
|
|
|
--TEST--
|
|
|
|
Redeclare inherited protected property as public.
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
class A
|
|
|
|
{
|
|
|
|
protected $p = "A::p";
|
|
|
|
function showA()
|
|
|
|
{
|
|
|
|
echo $this->p . "\n";
|
|
|
|
}
|
|
|
|
}
|
2018-09-16 17:16:42 +00:00
|
|
|
|
2008-01-30 14:25:57 +00:00
|
|
|
class B extends A
|
|
|
|
{
|
|
|
|
public $p = "B::p";
|
|
|
|
function showB()
|
|
|
|
{
|
|
|
|
echo $this->p . "\n";
|
|
|
|
}
|
|
|
|
}
|
2018-09-16 17:16:42 +00:00
|
|
|
|
|
|
|
|
2008-01-30 14:25:57 +00:00
|
|
|
$a = new A;
|
|
|
|
$a->showA();
|
2018-09-16 17:16:42 +00:00
|
|
|
|
2008-01-30 14:25:57 +00:00
|
|
|
$b = new B;
|
|
|
|
$b->showA();
|
|
|
|
$b->showB();
|
|
|
|
?>
|
2018-02-19 08:59:41 +00:00
|
|
|
--EXPECT--
|
2008-01-30 14:25:57 +00:00
|
|
|
A::p
|
|
|
|
B::p
|
|
|
|
B::p
|