ID: 43482 Updated by: [EMAIL PROTECTED] Reported By: dharma dot yp at in dot ibm dot com -Status: Open +Status: Closed Bug Type: Arrays related Operating System: Linux PHP Version: 5.2CVS-2007-12-03 (snap) New Comment:
Works fine in CVS, I've just tried it, both 5.3 and 5.2 return FALSE + warning in both cases. Previous Comments: ------------------------------------------------------------------------ [2007-12-03 11:07:19] dharma dot yp at in dot ibm dot com Description: ------------ When a negative value of -12345678900 is passed for pad_size argument of array_pad(), the function doesn't produce a warning in Linux environment but a warning message is output on Windows. Whereas, when a positive value of the above, i.e. 12345678900 is passed for pad_size argument, warning message is output on both Linux and windows. This behavior is observed in the testcase array_pad_variation2.phpt on Linux environment. Could you explain the reason behind this inconsistent behavior. This is applicable to PHP5.3 and PHP6 as well. Reproduce code: --------------- <?php $arr = array(1); var_dump( array_pad($arr, 12345678900, "hello") ); // warning generated var_dump( array_pad($arr, -12345678900, "hello") ); // no warning ?> Expected result: ---------------- Warning: array_pad(): You may only pad up to 1048576 elements at a time in %s on line %d bool(false) Warning: array_pad(): You may only pad up to 1048576 elements at a time in %s on line %d bool(false) Actual result: -------------- Warning: array_pad(): You may only pad up to 1048576 elements at a time in %s on line %d bool(false) array(1) { [0]=> int(1) } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43482&edit=1