#41836 [Fbk->Csd]: array_pad does not fill last element when using negative pad and empty source

From: Date: Thu, 28 Jun 2007 08:38:52 +0000
Subject: #41836 [Fbk->Csd]: array_pad does not fill last element when using negative pad and empty source
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-114385@lists.php.net to get a copy of this message
ID: 41836 User updated by: lubbers_corrado at yahoo dot com Reported By: lubbers_corrado at yahoo dot com -Status: Feedback +Status: Closed Bug Type: Unknown/Other Function Operating System: Windows XP SP2 PHP Version: 5.2.3 New Comment: i also cannot reproduce again...strange happenings on my system i assume . Previous Comments: ------------------------------------------------------------------------ [2007-06-28 08:28:11] tony2001@php.net Cannot reproduce. ------------------------------------------------------------------------ [2007-06-28 08:13:26] lubbers_corrado at yahoo dot com Description: ------------ When trying to fill an _empty_ array by using array_pad with negative direction, the last element will be padded but stays empty When the source Array has at least one element, this error does not occur Reproduce code: --------------- $foo = array(); $foo = array_pad($foo,-2,"bar"); echo print_r($foo,true); Expected result: ---------------- Array ( [0] => bar [1] => bar ); Actual result: -------------- Array ( [0] => bar [1] => ); ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41836&edit=1

« previous php.bugs (#114385) next »