mirror of
https://github.com/php/php-src.git
synced 2024-11-26 19:33:55 +08:00
35 lines
423 B
PHP
35 lines
423 B
PHP
--TEST--
|
|
Redeclare inherited protected property as public.
|
|
--FILE--
|
|
<?php
|
|
class A
|
|
{
|
|
protected $p = "A::p";
|
|
function showA()
|
|
{
|
|
echo $this->p . "\n";
|
|
}
|
|
}
|
|
|
|
class B extends A
|
|
{
|
|
public $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
|