From: orlum at mail dot ru Operating system: Fedora Core 1 PHP version: 5.0.1 PHP Bug Type: Zend Engine 2 problem Bug description: Undefined property notice appear when __get method access $this->OtherProperty
Description: ------------ When __get method accesses other property in some class, expected call to __get method not occurs, undefined property notice appears and null value of property returns. Reproduce code: --------------- <?PHP class A { public function __get($property) { echo "__get()\n"; if ($property == "B") return 1; elseif ($property == "C") return $this->B; } } error_reporting(E_ALL); $a = new A(); echo "B={$a->B}\n"; echo "C={$a->C}\n"; ?> Expected result: ---------------- __get() B=1 __get() __get() C=1 Actual result: -------------- __get() B=1 __get() Notice: Undefined property: A::$B in PHPDocument1 on line 12 C= -- Edit bug report at http://bugs.php.net/?id=30002&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30002&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30002&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30002&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=30002&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=30002&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30002&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30002&r=needscript Try newer version: http://bugs.php.net/fix.php?id=30002&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30002&r=support Expected behavior: http://bugs.php.net/fix.php?id=30002&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30002&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30002&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=30002&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30002&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=30002&r=dst IIS Stability: http://bugs.php.net/fix.php?id=30002&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30002&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30002&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30002&r=mysqlcfg