Bug #70193 [NEW]: Invalid numeric literal
| From: | phpbugs at caspertech dot co dot uk | Date: | Wed, 05 Aug 2015 11:53:34 +0000 |
| Subject: | Bug #70193 [NEW]: Invalid numeric literal | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-194963@lists.php.net to get a copy of this message | ||
From: phpbugs at caspertech dot co dot uk
Operating system: Gentoo
PHP version: 7.0.0beta2
Package: Variables related
Bug Type: Bug
Bug description:Invalid numeric literal
Description:
------------
In some cases, an apparently valid numeric literal is being detected as
an invalid numeric literal.
This is a regression since php5.4 - http://3v4l.org/MmCot
It can be fixed by changing the array to:
1, 3, 5, 7, 8, 10, 12
However, I believe this is possibly unintended behaviour (is there any
reason not to accept prefixed zeros?)
Test script:
---------------
<?php
class Test
{
protected static $months_31 = array( 01, 03, 05, 07, 08, 10, 12 );
}
?>
Expected result:
----------------
No output - I would expect these numeric literals to parse without
incident.
Actual result:
--------------
Parse error: Invalid numeric literal in /test.php on line 5
--
Edit bug report at https://bugs.php.net/bug.php?id=70193&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70193&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70193&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70193&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=70193&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=70193&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=70193&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=70193&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=70193&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=70193&r=support
Expected behavior: https://bugs.php.net/fix.php?id=70193&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=70193&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=70193&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=70193&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70193&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=70193&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=70193&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=70193&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70193&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=70193&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=70193&r=mysqlcfg