From: tater at potatoe dot com
Operating system: OS X 10.2
PHP version: 5CVS-2003-09-08 (dev)
PHP Bug Type: Zend Engine 2 problem
Bug description: public properties of parent class not accessible
Description:
------------
If a child class directly references a property defined in
the parent class, it no longer inherits it.
Reproduce code:
---------------
<?php
class base { public $x = 1; }
class foo extends base { }
class bar extends base
{
public function bartest()
{
var_dump($this->x);
}
}
$base = new base;
print_r($base);
$foo = new foo;
print_r($foo);
$bar = new bar;
print_r($bar);
$bar->bartest();
?>
Expected result:
----------------
base Object
(
[x] => 1
)
foo Object
(
[x] => 1
)
bar Object
(
[x] => 1
)
int(1)
Actual result:
--------------
base Object
(
[x] => 1
)
foo Object
(
[x] => 1
)
bar Object
(
)
Notice: Undefined property: bar::$x in /path/bug.php on line 12
NULL
--
Edit bug report at http://bugs.php.net/?id=25441&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25441&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25441&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=25441&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=25441&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=25441&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=25441&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=25441&r=support
Expected behavior: http://bugs.php.net/fix.php?id=25441&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=25441&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=25441&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=25441&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25441&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=25441&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=25441&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=25441&r=gnused