note 54599 added to function.array-merge

From: Date: Fri, 08 Jul 2005 18:37:41 +0000
Subject: note 54599 added to function.array-merge
Groups: php.notes 
Request: Send a blank email to php-notes+get-91697@lists.php.net to get a copy of this message
About the behavior of array_merge() that was modified in PHP5. The above warning says "array_merge() now only accepts parameters of type array". But it doesn't say what happens when array_merge() is given a non array parameter like in: <?php error_reporting(E_STRICT); $a = array("red","green"); $rgb = array_merge($a,"blue"); ?> In fact, the PHP5 version of array_merge() will perfectly accept the "blue" parameter and will return... the NULL value! Be aware that you will get no warning even with the error reporting level set to E_STRICT (which is supposed to catch "forward compatibility" troubles). ---- Manual Page -- http://www.php.net/manual/en/function.array-merge.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+54599 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54599&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54599&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54599&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54599&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54599&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54599&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+54599&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#91697) next »