note 114027 added to function.array-splice

From: Date: Thu, 02 Jan 2014 14:31:17 +0000
Subject: note 114027 added to function.array-splice
Groups: php.notes 
Request: Send a blank email to php-notes+get-198080@lists.php.net to get a copy of this message
Maybe it will help someone else: I was trying to strip off the last part of an array using this section, more or less as follows: <?php array_splice($array, $offset); ?> Now it could occur in my code that <?php $offset === 0 ?>, in which case the array is returned as-is and not, as you might expect, an empty array because everything is stripped off. Obviously it is not really useful anyway to "strip off everything", but I was reminded of that the hard way and this may spare someone some time, hopefully. ---- Server IP: 72.52.91.14 Probable Submitter: 72.52.91.14 ---- Manual Page -- http://php.net/manual/en/function.array-splice.php Edit -- https://master.php.net/note/edit/114027 Del: integrated -- https://master.php.net/note/delete/114027/integrated Del: useless -- https://master.php.net/note/delete/114027/useless Del: bad code -- https://master.php.net/note/delete/114027/bad+code Del: spam -- https://master.php.net/note/delete/114027/spam Del: non-english -- https://master.php.net/note/delete/114027/non-english Del: in docs -- https://master.php.net/note/delete/114027/in+docs Del: other reasons-- https://master.php.net/note/delete/114027 Reject -- https://master.php.net/note/reject/114027 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#198080) next »