|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-05-10 17:32 UTC] elitearefin at gmail dot com
-Summary: Array pointer does not work properly.
+Summary: Array pointer does not work properly. I'm using
wampserver 2.5
[2014-05-10 17:32 UTC] elitearefin at gmail dot com
[2014-05-10 18:23 UTC] rasmus@php.net
-Status: Open
+Status: Not a bug
[2014-05-10 18:23 UTC] rasmus@php.net
[2014-05-11 09:31 UTC] elitearefin at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 19 18:00:02 2025 UTC |
Description: ------------ When using array pointer "next()" in an array like "$age = [04,08,09,16,23,32,38,39,40,44];" or "$num = [01,02,03,04,05,06,07,08,09,10];" and echo the result, the number "08" and "09" give "0". Test script: --------------- <?php $age = [04,08,09,16,23,32,38,39,40,44]; $num = [01,02,03,04,05,06,07,08,09,10]; echo current($num) . " : " . current($age) . "<br>"; next($num); next($age); echo current($num) . " : " . current($age) . "<br>"; next($num); next($age); echo current($num) . " : " . current($age) . "<br>"; next($num); next($age); echo current($num) . " : " . current($age) . "<br>"; next($num); next($age); echo current($num) . " : " . current($age) . "<br>"; next($num); next($age); echo current($num) . " : " . current($age) . "<br>"; next($num); next($age); echo current($num) . " : " . current($age) . "<br>"; next($num); next($age); echo current($num) . " : " . current($age) . "<br>"; next($num); next($age); echo current($num) . " : " . current($age) . "<br>"; next($num); next($age); echo current($num) . " : " . current($age) . "<br>"; ?> Expected result: ---------------- 1 : 4 2 : 8 3 : 9 4 : 16 5 : 23 6 : 32 7 : 38 8 : 39 9 : 40 10 : 44 Actual result: -------------- 1 : 4 2 : 0 3 : 0 4 : 16 5 : 23 6 : 32 7 : 38 0 : 39 0 : 40 10 : 44