Bug #14287 Updated: array_diff takes string as second argument

From: Date: Thu, 29 Nov 2001 18:11:51 +0000
Subject: Bug #14287 Updated: array_diff takes string as second argument
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-72052@lists.php.net to get a copy of this message
ID: 14287 Updated by: derick Reported By: stefan.priebsch@e-novative.de Old Status: Open Status: Closed Bug Type: Scripting Engine problem Operating System: W2K PHP Version: 4.0.6 New Comment: Both PHP 4.1.0 and php 4.2.0 dev already show this warning: <b>Warning</b>: Argument #2 to array_diff() is not an array in <b>-</b> on line <b>2</b><br> so closing, Derick Previous Comments: ------------------------------------------------------------------------ [2001-11-29 12:39:46] stefan.priebsch@e-novative.de Seems like array_diff will take a string as second argument, e.g. array_diff ($bla, "fred") where $bla is an array. No error or warning will appear, and array_diff will not work as expected (which would be removing "fred" from $bla). Of course everything works fine using array_diff ($bla, array ("fred")) However, for the above case imho there should either be a compiler warning or a note added to the manual. Steve ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=14287&edit=1

« previous php.dev (#72052) next »