|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-03-31 19:15 UTC] disas at mail dot ru
Description:
------------
Bug on result where negative or positive number of limit is very high.
Reproduce code:
---------------
#Code:
var_export(
explode(" "," 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ", -1e99)
);
#Result:
array (
0 => ' 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ',
);
#Code:
var_export(
explode(" "," 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ", -1e9)
);
#Result:
array (
)
Expected result:
----------------
array (
0 => ' 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ',
);
Actual result:
--------------
I think that in both cases the result should be:
array(
)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 01:00:01 2025 UTC |
Very strange results with HEAD/PHP_5_3 too: # build/php_6/sapi/cli/php -n -dmemory_limit=2G -r 'var_dump(explode(" "," 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ", -1e99));' Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 18446744073383068122 bytes) in Command line code on line 1 # build/php_5_3/sapi/cli/php -n -dmemory_limit=2G -r 'var_dump(explode(" "," 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ", -1e99));' Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 3792765909 bytes) in Command line code on line 1 # build/php_5_2/sapi/cli/php -n -dmemory_limit=2G -r 'var_dump(explode(" "," 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ", -1e99));' array(1) { [0]=> string(43) " 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 " }