Bug #67243 [NEW]: Array pointer does not work properly.

From: Date: Sat, 10 May 2014 17:28:50 +0000
Subject: Bug #67243 [NEW]: Array pointer does not work properly.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-185750@lists.php.net to get a copy of this message
From: elitearefin at gmail dot com Operating system: windows 8.1 PHP version: 5.5.12 Package: Arrays related Bug Type: Bug Bug description:Array pointer does not work properly. 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 -- Edit bug report at https://bugs.php.net/bug.php?id=67243&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=67243&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=67243&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=67243&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=67243&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=67243&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=67243&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=67243&r=needscript Try newer version: https://bugs.php.net/fix.php?id=67243&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=67243&r=support Expected behavior: https://bugs.php.net/fix.php?id=67243&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=67243&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=67243&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=67243&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=67243&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=67243&r=dst IIS Stability: https://bugs.php.net/fix.php?id=67243&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=67243&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=67243&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=67243&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=67243&r=mysqlcfg

« previous php.bugs (#185750) next »