]> granicus.if.org Git - php/commitdiff
New test
authorFelipe Pena <felipe@php.net>
Thu, 14 Feb 2008 13:50:36 +0000 (13:50 +0000)
committerFelipe Pena <felipe@php.net>
Thu, 14 Feb 2008 13:50:36 +0000 (13:50 +0000)
ext/standard/tests/array/bug42838.phpt [new file with mode: 0644]

diff --git a/ext/standard/tests/array/bug42838.phpt b/ext/standard/tests/array/bug42838.phpt
new file mode 100644 (file)
index 0000000..1f895f3
--- /dev/null
@@ -0,0 +1,24 @@
+--TEST--
+Bug#42838 - Wrong results in array_diff_uassoc
+--FILE--
+<?php
+
+function key_compare_func($a, $b)
+{
+       if ($a === $b) {
+               return 0;
+       }
+       return ($a > $b)? 1:-1;
+}
+
+$array1 = array("a" => "green", "b" => "Brown", 'c' => 'blue', 0 => 'red');
+$array2 = array("a" => "green", "b" => "Brown", 'c' => 'blue', 0 => 'red');
+
+$result = array_diff_uassoc($array1, $array2, "key_compare_func");
+print_r($result);
+
+?>
+--EXPECT--
+Array
+(
+)
\ No newline at end of file