mirror of
https://github.com/php/php-src.git
synced 2024-10-21 00:12:34 +00:00
28 lines
352 B
Plaintext
28 lines
352 B
Plaintext
|
--TEST--
|
||
|
Child public element should not override parent private element in parent methods
|
||
|
--FILE--
|
||
|
<?php
|
||
|
class par {
|
||
|
private $id = "foo";
|
||
|
|
||
|
function displayMe()
|
||
|
{
|
||
|
print $this->id;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
class chld extends par {
|
||
|
public $id = "bar";
|
||
|
function displayHim()
|
||
|
{
|
||
|
parent::displayMe();
|
||
|
}
|
||
|
};
|
||
|
|
||
|
|
||
|
$obj = new chld();
|
||
|
$obj->displayHim();
|
||
|
?>
|
||
|
--EXPECT--
|
||
|
foo
|