Bug #73990 [NEW]: array key leading zero inconsistent parse error
| From: | zewy at hotmail dot com | Date: | Wed, 25 Jan 2017 10:14:03 +0000 |
| Subject: | Bug #73990 [NEW]: array key leading zero inconsistent parse error | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-206939@lists.php.net to get a copy of this message | ||
From: zewy at hotmail dot com
Operating system: Linux
PHP version: 7.1.1
Package: Compile Failure
Bug Type: Bug
Bug description:array key leading zero inconsistent parse error
Description:
------------
array key with a leading 0 and any digit except for 8 or 9 will not
result in Parse error!
This have bin sens php 7.0+
Test script:
---------------
$a =
array(00=>'OK',01=>'OK',02=>'OK',03=>'OK',04=>'OK',05=>'OK',06=>'OK',07=>'OK',10=>'OK',18=>'OK',19=>'OK');
#$b =
array(08=>'08',09=>'09',018=>'018',019=>'019');
print_r($a);
Expected result:
----------------
Parse error: Invalid numeric literal in X on line Y
Actual result:
--------------
Array
(
[0] => OK
[1] => OK
[2] => OK
[3] => OK
[4] => OK
[5] => OK
[6] => OK
[7] => OK
[10] => OK
[18] => OK
[19] => OK
)
--
Edit bug report at https://bugs.php.net/bug.php?id=73990&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73990&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73990&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73990&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73990&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73990&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73990&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73990&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73990&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73990&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73990&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73990&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73990&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73990&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73990&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73990&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73990&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73990&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73990&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73990&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73990&r=mysqlcfg