ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-dev
php-dev
#44965 [Opn]: Zend affects on arrays
by Yektaweb At Gmail Dot Com other posts by this author
May 10 2008 2:43PM messages near this date
#44965 [Com]: Zend affects on arrays | #44965 [Opn]: Zend affects on arrays
ID:               44965
 User updated by:  yektaweb at gmail dot com
 Reported By:      yektaweb at gmail dot com
 Status:           Open
 Bug Type:         Arrays related
 Operating System: win xp
 PHP Version:      5.2.6
 New Comment:

The following code will not affected by Zend Opt.

foreach ($arr as $key =>  $value) {
    echo "Key: $key; Value: $value<br /> \n";
}


Previous Comments:
------------------------------------------------------------------------

[2008-05-10 21:29:08] yektaweb at gmail dot com

I am using 
Apache/2.2.0
Zend Optimizer v3.3.0
Zend SG Suite 3.1.0

------------------------------------------------------------------------

[2008-05-10 21:22:05] yektaweb at gmail dot com

Description:
------------
Zend affects on arrays (PHP Version 5.1.2)

Reproduce code:
---------------
<?php
$fruits = array ("h" =>  "orange", "b" => "banana", "c" => "apple");

	foreach ($fruits as $value) 
	{
		$my_f = key($fruits);
		echo $my_f . '<br> <br>';
		next($fruits);
	}
?> 


Expected result:
----------------
h

b

c


Actual result:
--------------
b

b

c



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=44965&edit=1
Thread:
Yektaweb At Gmail Dot Com
derick
Crrodriguez At Suse Dot De
Yektaweb At Gmail Dot Com
Yektaweb At Gmail Dot Com

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved