From: seanius at debian dot org Operating system: Debian PHP version: 5.3.1 PHP Bug Type: Unknown/Other Function Bug description: array keys with huge ints failing
Description: ------------ found in the debian build, but i can reproduce it on an pristine snapshot. see also: #45877, #48254 for background, though these are reported as fixed (regression maybe?). it seems that the last array item is being ignored instead of being converted into a string key. rangda[/home/sean/Download/php5.3-201002160730] ./run-tests.php --show-all -p ./sapi/cli/php ./Zend/tests/bug45877.phpt ===================================================================== PHP : ./sapi/cli/php PHP_SAPI : cli PHP_VERSION : 5.3.3-dev ZEND_VERSION: 2.3.0 PHP_OS : Linux - Linux rangda 2.6.32-trunk-amd64 #1 SMP Sun Jan 10 22:40:40 UTC 2010 x86_64 INI actual : /home/sean/Download/php5.3-201002160730 More .INIs : CWD : /home/sean/Download/php5.3-201002160730 Extra dirs : VALGRIND : Not used ===================================================================== Running selected tests. TEST 1/1 [Zend/tests/bug45877.phpt] ========TEST======== <?php $keys = array(PHP_INT_MAX, (string) PHP_INT_MAX, (string) (-PHP_INT_MAX - 1), -PHP_INT_MAX - 1, (string) (PHP_INT_MAX + 1)); var_dump(array_fill_keys($keys, 1)); ?> ========DONE======== ========OUT======== array(2) { [9223372036854775807]=> int(1) [-9223372036854775808]=> int(1) } ========DONE======== ========EXP======== array(3) { [%d7]=> int(1) [-%d8]=> int(1) ["%d8"]=> int(1) } ========DONE======== ========DIFF======== 001+ array(2) { 001- array(3) { 006- ["%d8"]=> 007- int(1) ========DONE======== FAIL Bug #45877 (Array key '2147483647' left as string) [Zend/tests/bug45877.phpt] ===================================================================== Number of tests : 1 1 Tests skipped : 0 ( 0.0%) -------- Tests warned : 0 ( 0.0%) ( 0.0%) Tests failed : 1 (100.0%) (100.0%) Expected fail : 0 ( 0.0%) ( 0.0%) Tests passed : 0 ( 0.0%) ( 0.0%) --------------------------------------------------------------------- Time taken : 0 seconds ===================================================================== ===================================================================== FAILED TEST SUMMARY --------------------------------------------------------------------- Bug #45877 (Array key '2147483647' left as string) [Zend/tests/bug45877.phpt] ===================================================================== Reproduce code: --------------- ./Zend/tests/bug45877.phpt Expected result: ---------------- PASS Actual result: -------------- FAIL -- Edit bug report at http://bugs.php.net/?id=51061&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51061&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51061&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51061&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=51061&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51061&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=51061&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=51061&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=51061&r=needscript Try newer version: http://bugs.php.net/fix.php?id=51061&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=51061&r=support Expected behavior: http://bugs.php.net/fix.php?id=51061&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=51061&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=51061&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=51061&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51061&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=51061&r=dst IIS Stability: http://bugs.php.net/fix.php?id=51061&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=51061&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=51061&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=51061&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=51061&r=mysqlcfg