Bug #67243 [Com]: Array pointer does not work properly. I'm using wampserver 2.5

From: Date: Sun, 11 May 2014 09:31:19 +0000
Subject: Bug #67243 [Com]: Array pointer does not work properly. I'm using wampserver 2.5
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-185756@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67243&edit=1

 ID:                 67243
 Comment by:         elitearefin at gmail dot com
 Reported by:        elitearefin at gmail dot com
 Summary:            Array pointer does not work properly. I'm using
                     wampserver 2.5
 Status:             Not a bug
 Type:               Bug
 Package:            Arrays related
 Operating System:   windows 8.1
 PHP Version:        5.5.12
 Block user comment: N
 Private report:     N

 New Comment:

O! Thanks for quick reply..


Previous Comments:
------------------------------------------------------------------------
[2014-05-10 18:23:17] rasmus@php.net

A leading zero indicates an octal number. 08 and 09 are not valid octal numbers.

------------------------------------------------------------------------
[2014-05-10 17:32:48] elitearefin at gmail dot com

I'm using wampserver 2.5

------------------------------------------------------------------------
[2014-05-10 17:28:50] elitearefin at gmail dot com

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 this bug report at https://bugs.php.net/bug.php?id=67243&edit=1


Thread (4 messages)

« previous php.bugs (#185756) next »