php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31124 foreach bug for only value
Submitted: 2004-12-16 14:53 UTC Modified: 2004-12-17 02:32 UTC
From: honestqiao at sohu dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.3.10 OS: Windows NT
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: honestqiao at sohu dot com
New email:
PHP Version: OS:

 

 [2004-12-16 14:53 UTC] honestqiao at sohu dot com
Description:
------------
Run Env 1:
Windows NT LOCALHOST 5.1 build 2600/WinXP SP2 Pro
Apache2.0.52
PHP4.3.10
Zend Optimizer-2.5.5


Run Env 2:
Windows NT XYSTER_WIN2K 5.0 build 2195 
Apache1.3.27
PHP4.3.10
Zend Optimizer-2.1.0

If don't use Zend Optimizer,it's Expected result.
If use Zend Optimizer,it's Actual result.

If use Turck MMCache 2.4.6 , it's Expected result.

Reproduce code:
---------------
<?php
$intArray = array (1, 2, 3, 17);
foreach ($intArray as $value) {
   print "Current value of \$intArray: $value.\n";
}
?>

Expected result:
----------------
Current value of $intArray: 1. 
Current value of $intArray: 2. 
Current value of $intArray: 3. 
Current value of $intArray: 17.


Actual result:
--------------
Current value of $intArray: Array. 
Current value of $intArray: Array. 
Current value of $intArray: Array. 
Current value of $intArray: Array.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-16 15:08 UTC] derick@php.net
See #31123
 [2004-12-17 02:32 UTC] honestqiao at sohu dot com
No bugs.
download Zend Optimizer-2.5.7 from 
http://www.zend.com/store/products/zend-optimizer.php
http://www.zend.com/store/free_download.php?pid=13
and upgrade/use it for php4.3.10.
It's work well.

Description:
------------
Run Env 1:
Windows NT LOCALHOST 5.1 build 2600/WinXP SP2 Pro
Apache2.0.52
PHP4.3.10
Zend Optimizer-2.5.5

Run Env 2:
Windows NT XYSTER_WIN2K 5.0 build 2195 
Apache1.3.27
PHP4.3.10
Zend Optimizer-2.1.0

If don't use Zend Optimizer,it's Expected result.
If use Zend Optimizer,it's Actual result.

If use Turck MMCache 2.4.6 , it's Expected result.

Reproduce code:
---------------
<?php
$intArray = array (1, 2, 3, 17);
foreach ($intArray as $value) {
   print "Current value of \$intArray: $value.\n";
}
?>

Expected result:
----------------
Current value of $intArray: 1. 
Current value of $intArray: 2. 
Current value of $intArray: 3. 
Current value of $intArray: 17.

Actual result:
--------------
Current value of $intArray: Array. 
Current value of $intArray: Array. 
Current value of $intArray: Array. 
Current value of $intArray: Array.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 05:01:33 2025 UTC