|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesabs (last revision 2013-01-30 21:34 UTC by xi dot wang at gmail dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-02-17 03:46 UTC] laruence@php.net
-Assigned To:
+Assigned To: laruence
[2013-02-17 03:46 UTC] laruence@php.net
[2017-10-24 08:04 UTC] kalle@php.net
-Status: Assigned
+Status: Open
-Assigned To: laruence
+Assigned To:
[2017-10-24 08:35 UTC] requinix@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: requinix
[2017-10-24 08:35 UTC] requinix@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 06:00:02 2025 UTC |
Description: ------------ Using `abs(pad_size) < 0' to catch the LONG_MIN case invokes undefined behavior in C. gcc simply assumes abs(pad_size) must be non-negative and discards the check. Test script: --------------- <?php // This is for 64-bit systems. $input = array(12, 10, 9); $input = array_pad($input, -9223372036854775808, 0); var_dump($input); ?> Expected result: ---------------- Warning: array_pad(): You may only pad up to 1048576 elements at a time in t.php on line 3 bool(false) Actual result: -------------- array(3) { [0]=> int(12) [1]=> int(10) [2]=> int(9) }