php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31251 Bad problems with backported foreach() patch
Submitted: 2004-12-22 17:47 UTC Modified: 2004-12-22 19:48 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: giovanni at giacobbi dot net Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.3.10 OS: Linux
Private report: No CVE-ID: None
 [2004-12-22 17:47 UTC] giovanni at giacobbi dot net
Description:
------------
I've been a PHP developer for years and I don't remember such a big bug introduced in a stable production release.

The foreach() patch backported from PHP5 broke down many sites that I run and which use proprietary optimizers.

You should definitely remember what "stable" and "production" words mean, and keep fun for PHP5.

P.S.: The bug is indeed in the optimizer, but this doesn't allow you to make these kind of changes.


Reproduce code:
---------------
this is just explanative, the bug can be shown only with the proprietary optimizer.

$a = array(array("a", "b"), array("a", "b"));

foreach ($a as $ax) { var_dump($a); }

Expected result:
----------------
obvious.

Actual result:
--------------
scratched array.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-22 18:23 UTC] tony2001@php.net
Do not file bugs when you have Zend extensions (zend_extension=)
loaded. Examples are Zend Optimizer, Zend Debugger, Turck MM Cache,
APC, Xdebug and ionCube loader.  These extensions often modify engine
behavior which is not related to PHP itself.


 [2004-12-22 18:23 UTC] derick@php.net
Do not file bugs when you have Zend extensions (zend_extension=)
loaded. Examples are Zend Optimizer, Zend Debugger, Turck MM Cache,
APC, Xdebug and ionCube loader.  These extensions often modify engine
behavior which is not related to PHP itself.

What the hell do you mean by that? It's not *our* job to keep external stuff being compatible with PHP. If we want to increase performance, we do that. Other people'll have to adjust their proprietary software to that. Period.
 [2004-12-22 18:30 UTC] iliaa@php.net
The foreach bug is ONLY caused due to an old Zend Optimizer. Upgrading to a newer version fixes the problem, this is NOT a PHP bug.
 [2004-12-22 18:46 UTC] giovanni at giacobbi dot net
I KNOW that, but when you provide a valuable software you also "promise" to proprietary vendors that you won't change the underlying infrastructure. This is the purpose of stable and frozen branches.

Is it possible to have a REAL BUGFIX ONLY branch of PHP 4.3?
 [2004-12-22 19:07 UTC] derick@php.net
We don't promise anything, as you can read in our license (http://www.php.net/license/3_0.txt):

THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND 
ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE PHP
DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
 [2004-12-22 19:48 UTC] giovanni at giacobbi dot net
So what? Did I ask for any money? I did not.

I just told you are bad developers. That's all.

I also submitted a few patches in the past years and months that were not included nor replied back nor commented.

So I definitely think that.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 14 17:01:34 2025 UTC