array_diff not working with last element different

From: Date: Tue, 27 Aug 2002 13:39:57 +0000
Subject: array_diff not working with last element different
Groups: php.dev 
Request: Send a blank email to php-dev+get-87525@lists.php.net to get a copy of this message
When using array diff, if the last element and only the last element is different it won't be returned as a difference. <? $ar = array("b" => 1, "blah" => 1); $a1 = array("b" => 2, "blah" => 2); var_dump(array_diff($ar, $a1)); ?> array(2) { ["b"]=> int(1) ["blah"]=> int(1) } <? $ar = array("b" => 1, "blah" => 1); $a1 = array("b" => 1, "blah" => 2); var_dump(array_diff($ar, $a1)); ?> array(0) { } I can't look at this right now maybe I can later or tomarrow. - Brad __________________________________________________ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com

« previous php.dev (#87525) next »