Bug #73172 [Opn]: parse error: Invalid numeric literal
| From: | nikic@php.net | Date: | Mon, 26 Sep 2016 09:46:09 +0000 |
| Subject: | Bug #73172 [Opn]: parse error: Invalid numeric literal | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-204273@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73172&edit=1
ID: 73172
Updated by: nikic@php.net
Reported by: elbazmichael92 at gmail dot com
Summary: parse error: Invalid numeric literal
Status: Open
Type: Bug
Package: *General Issues
Operating System: Windows 7
PHP Version: 7.0.11
Block user comment: N
Private report: N
New Comment:
It looks like we're using strtod compiled with USE_LOCALE, something we probably shouldn't
be doing.
Previous Comments:
------------------------------------------------------------------------
[2016-09-26 09:01:02] elbazmichael92 at gmail dot com
to reproduc the bug you need use two file:
a.php
<?php
setlocale(LC_ALL, 'fr_FR.utf8', 'fra'); //LC_ALL
require 'patch.php';
then in patch.php
<?php
function t($a, $x, $y){
return;
}
t('test', 2147483649, 'test');
the probleme is with the setlocal function in cli mode and php > 7 version its not happen with
previous version.
------------------------------------------------------------------------
[2016-09-26 08:14:46] elbazmichael92 at gmail dot com
this is happen only with this configuration setlocale(LC_ALL, 'fr_FR.utf8',
'fra');
------------------------------------------------------------------------
[2016-09-26 07:44:29] elbazmichael92 at gmail dot com
Description:
------------
On php cli only (all version > 7) this code will throw parse error: Invalid numeric literal the
problem only with int parameter greater than 2147483647 (unsigned int)
function test($a, $x, $y){
return;
}
test('test', 2147483648, 'test');
the only solution i found is to add space after the int parameter:
test('test', 2147483648 , 'test');
i found this bug using the phpseclib lib class SFTP line 1294.
Test script:
---------------
function test($a, $x, $y){
return;
}
test('test', 2147483648, 'test');
Expected result:
----------------
running without error
Actual result:
--------------
Parse error: Invalid numeric literal
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73172&edit=1