From: php dot net at benjamin dot schulz dot name
Operating system: linux
PHP version: 5.0.1
PHP Bug Type: Unknown/Other Function
Bug description: protected member overrides private
Description:
------------
protected member overrides private
Reproduce code:
---------------
<?php
class foo {
private $foo = 'foo';
function printFoo()
{
echo __CLASS__, ': ', $this->foo, '<br />';
}
}
class bar extends foo {
protected $foo = 'bar';
function printFoo()
{
parent::printFoo();
echo __CLASS__, ': ', $this->foo, '<br />';
}
}
class baz extends bar {
protected $foo = 'baz';
}
$bar = new bar;
$bar->printFoo();
echo '<hr />';
$baz = new baz();
$baz->printFoo();
?>
Expected result:
----------------
foo: foo
bar: bar
--
foo: foo
bar: baz
Actual result:
--------------
foo: foo
bar: bar
--
foo: baz
bar: baz
--
Edit bug report at http://bugs.php.net/?id=29689&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29689&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29689&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=29689&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=29689&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29689&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=29689&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=29689&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=29689&r=support
Expected behavior: http://bugs.php.net/fix.php?id=29689&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=29689&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=29689&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=29689&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29689&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=29689&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=29689&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=29689&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29689&r=float