note 114501 added to function.array-pop
| From: | Anonymous | Date: | Fri, 28 Feb 2014 08:21:47 +0000 |
| Subject: | note 114501 added to function.array-pop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-198745@lists.php.net to get a copy of this message | ||
Strict Standards will be thrown out if you put exploded array in array_pop:
<?php
$a = array_pop(explode(",", "a,b,c"));
echo $a;
?>
You will see:
PHP Strict Standards: Only variables should be passed by reference in - on line 2
Strict Standards: Only variables should be passed by reference in - on line 2
c
Notice that, you should assign a variable for function explode, then pass the variable reference
into array_pop to avoid the Strict Standard warning.
----
Server IP: 72.52.91.14
Probable Submitter: 72.52.91.14
----
Manual Page -- http://php.net/manual/en/function.array-pop.php
Edit -- https://master.php.net/note/edit/114501
Del: integrated -- https://master.php.net/note/delete/114501/integrated
Del: useless -- https://master.php.net/note/delete/114501/useless
Del: bad code -- https://master.php.net/note/delete/114501/bad+code
Del: spam -- https://master.php.net/note/delete/114501/spam
Del: non-english -- https://master.php.net/note/delete/114501/non-english
Del: in docs -- https://master.php.net/note/delete/114501/in+docs
Del: other reasons-- https://master.php.net/note/delete/114501
Reject -- https://master.php.net/note/reject/114501
Search -- https://master.php.net/manage/user-notes.php