note 102923 added to function.array-slice

From: Date: Tue, 15 Mar 2011 01:33:52 +0000
Subject: note 102923 added to function.array-slice
Groups: php.notes 
Request: Send a blank email to php-notes+get-177880@lists.php.net to get a copy of this message
This function has an upper limit to how big the length parameter can be. For instance, this will return an empty array: $this=array('1','2','3','4'); print_r(array_splice($this,2,1000000000000000 000000000000000000000000000000000000000 000000000000000000000000000000000)); So, if you're a rookie like me, yes you have to detect the upper limit of the length and not just default it to a very large number ---- Server IP: 69.147.83.197 Probable Submitter: 99.65.176.50 ---- Manual Page -- http://www.php.net/manual/en/function.array-slice.php Edit -- https://master.php.net/note/edit/102923 Del: integrated -- https://master.php.net/note/delete/102923/integrated Del: useless -- https://master.php.net/note/delete/102923/useless Del: bad code -- https://master.php.net/note/delete/102923/bad+code Del: spam -- https://master.php.net/note/delete/102923/spam Del: non-english -- https://master.php.net/note/delete/102923/non-english Del: in docs -- https://master.php.net/note/delete/102923/in+docs Del: other reasons-- https://master.php.net/note/delete/102923 Reject -- https://master.php.net/note/reject/102923 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#177880) next »