|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-06-28 08:13 UTC] 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] => ); PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Mon Sep 14 01:00:01 2026 UTC |
Ok, i can reproduce again. it only happens when generating an array by splitting an empty string. Check the example again, please $foo = explode('*',""); $foo = array_pad($foo,-2,"bar"); echo print_r($foo,true);