mirror of
https://github.com/php/php-src.git
synced 2024-10-20 07:53:58 +00:00
31 lines
314 B
Plaintext
31 lines
314 B
Plaintext
|
--TEST--
|
||
|
'Static' binding for private variables
|
||
|
--FILE--
|
||
|
<?php
|
||
|
|
||
|
class par {
|
||
|
private $id="foo";
|
||
|
|
||
|
function displayMe()
|
||
|
{
|
||
|
$this->displayChild();
|
||
|
}
|
||
|
};
|
||
|
|
||
|
class chld extends par {
|
||
|
private $id = "bar";
|
||
|
|
||
|
function displayChild()
|
||
|
{
|
||
|
print $this->id;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
|
||
|
$obj = new chld();
|
||
|
$obj->displayMe();
|
||
|
|
||
|
?>
|
||
|
--EXPECT--
|
||
|
bar
|