#35974 [NEW]: zendenc breaks simple for-loop

From: Date: Thu, 12 Jan 2006 00:09:44 +0000
Subject: #35974 [NEW]: zendenc breaks simple for-loop
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-91782@lists.php.net to get a copy of this message
From: ak at avatartechnology dot com Operating system: Linux PHP version: 4.4.1 PHP Bug Type: *Compile Issues Bug description: zendenc breaks simple for-loop Description: ------------ The attached code behaves differently when Zend-compiled versus not. (It breaks when Zend-compiled). It looks like maybe the for-loop is getting optimized away, incorrectly. The Zend Optimizer running on the server is: Zend Optimizer v2.5.5. I'll post the version of the Zend compiler when I get a chance to look it up. I lied about the PHP version (4.3.9) because upgrading to test is not practical, but it seems to depend on the encoder version, not the PHP version. Reproduce code: --------------- function include_next() { # Infer the calling file from the backtrace $bt = debug_backtrace(); for ($i=0; $bt[$i] && !$bt[$i]['file']; $i++); $caller = $bt[$i]['file']; assert($caller); // ... do some stuff with $caller } Expected result: ---------------- I expect the assertion to NOT fail. Actual result: -------------- Assertion fails. -- Edit bug report at http://bugs.php.net/?id=35974&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=35974&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=35974&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=35974&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=35974&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=35974&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=35974&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=35974&r=needscript Try newer version: http://bugs.php.net/fix.php?id=35974&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=35974&r=support Expected behavior: http://bugs.php.net/fix.php?id=35974&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=35974&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=35974&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=35974&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35974&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=35974&r=dst IIS Stability: http://bugs.php.net/fix.php?id=35974&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=35974&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=35974&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=35974&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=35974&r=mysqlcfg

« previous php.bugs (#91782) next »