|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2016-09-26 07:44 UTC] 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
PatchesInvalid_parsing (last revision 2016-09-26 07:49 UTC by elbazmichael92 at gmail dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
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.