Bug #67294 [NEW]: Operation performed on wrong property during interaction with an error handler

From: Date: Fri, 16 May 2014 19:54:58 +0000
Subject: Bug #67294 [NEW]: Operation performed on wrong property during interaction with an error handler
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-185840@lists.php.net to get a copy of this message
From: pmoroney at name dot com Operating system: Linux PHP version: master-Git-2014-05-16 (Git) Package: Scripting Engine problem Bug Type: Bug Bug description:Operation performed on wrong property during interaction with an error handler Description: ------------ When an error handler is called because of a undefined property and the error handler references a different object property that doesn't exist, even in an isset(), the original property gets replaced by the new property in the operation that was being performed. I ran a git bisect to find the commit that introduced the error and found the following commit: commit 0c6d903ce7615a7197cb997d67d98058c3ec5d6a Author: Stanislav Malyshev <stas@php.net> Date: Mon Feb 18 20:56:02 2013 -0800 fix bug #49348 - issue notice on get_property_ptr_ptr when used for read Test script: --------------- <?php function err_handler() { $s = new StdClass(); isset($s->bad); } set_error_handler('err_handler'); $f->good += 5 ; var_export($f); if(isset($f->bad)) exit(1); else exit(0); Expected result: ---------------- stdClass::__set_state(array( 'bad' => 5, )) With an Exit value of 1 Actual result: -------------- stdClass::__set_state(array( 'good' => 5, )) With an Exit value of 0 -- Edit bug report at https://bugs.php.net/bug.php?id=67294&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=67294&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=67294&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=67294&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=67294&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=67294&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=67294&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=67294&r=needscript Try newer version: https://bugs.php.net/fix.php?id=67294&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=67294&r=support Expected behavior: https://bugs.php.net/fix.php?id=67294&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=67294&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=67294&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=67294&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=67294&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=67294&r=dst IIS Stability: https://bugs.php.net/fix.php?id=67294&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=67294&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=67294&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=67294&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=67294&r=mysqlcfg

« previous php.bugs (#185840) next »