Bug #17654 Updated: array_merge() throws warning when supplied with 1 argument only

From: Date: Sat, 08 Jun 2002 12:34:45 +0000
Subject: Bug #17654 Updated: array_merge() throws warning when supplied with 1 argument only
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-9841@lists.php.net to get a copy of this message
ID: 17654 Updated by: sander@php.net Reported By: carlos@wfmh.org.pl Status: Open Bug Type: Arrays related Operating System: Linux GNU/Debian PHP Version: 4.2.1 New Comment: Don't know if we want to change this. I don't quite see the use of it. Anyway, if you want to change it yourself look at line 1934 of /ext/standard/array.c and change the 2 to 1 (in the function php_array_merge_wrapper). Previous Comments: ------------------------------------------------------------------------ [2002-06-08 08:16:39] carlos@wfmh.org.pl array_merge() throws an "Wrong parameter count" if called with only 1 argument given. I consider it a bug, as there's no technical reason it should act that way. One can say merging one array makes no sense, which is correct from logical point of view, but from the ther side, technical, there's nothing that I can imagine to prevent array_merge() to handle this case w/o any error. Currently if I write a code that utilises array_merge() and I plan it to scale later on, I can 't simply write $res = array_merge( $arr1 ); and expand the lists later on, if I get more arrays. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=17654&edit=1

« previous php.bugs (#9841) next »