note 112740 added to function.array-chunk
| From: | ViniH | Date: | Thu, 18 Jul 2013 16:02:42 +0000 |
| Subject: | note 112740 added to function.array-chunk | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-195665@lists.php.net to get a copy of this message | ||
Note: array_chunk returns an empty array if given an empty array as the input.
This can cause unexpected results in certain circumstances (especially if working with haanga/django
templating engines).
The solution is to always check that the input array is not empty. This is standard good practice
but can sometimes be overlooked.
----
Server IP: 69.147.83.199
Probable Submitter: 89.167.143.229
----
Manual Page -- http://php.net/manual/en/function.array-chunk.php
Edit -- https://master.php.net/note/edit/112740
Del: integrated -- https://master.php.net/note/delete/112740/integrated
Del: useless -- https://master.php.net/note/delete/112740/useless
Del: bad code -- https://master.php.net/note/delete/112740/bad+code
Del: spam -- https://master.php.net/note/delete/112740/spam
Del: non-english -- https://master.php.net/note/delete/112740/non-english
Del: in docs -- https://master.php.net/note/delete/112740/in+docs
Del: other reasons-- https://master.php.net/note/delete/112740
Reject -- https://master.php.net/note/reject/112740
Search -- https://master.php.net/manage/user-notes.php