Annotation of embedaddon/php/ext/standard/tests/array/array_diff_assoc_variation10.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test array_diff_assoc() function : usage variations - binary safe check
                      3: --FILE--
                      4: <?php
                      5: /* Prototype  : array array_diff_assoc(array $arr1, array $arr2 [, array ...])
                      6:  * Description: Returns the entries of arr1 that have values which are not 
                      7:  * present in any of the others arguments but do additional checks whether 
                      8:  * the keys are equal 
                      9:  * Source code: ext/standard/array.c
                     10:  */
                     11: 
                     12: /*
                     13:  * Test how array_diff_assoc() compares binary data
                     14:  */
                     15: 
                     16: echo "*** Testing array_diff_assoc() : usage variations ***\n";
                     17: 
                     18: $array1 = array( b"1", 
                     19:                  b"hello", 
                     20:                  "world", 
                     21:                  "str1" => "hello", 
                     22:                  "str2" => "world");
                     23: 
                     24: $array2 = array( b"1" => 'hello',
                     25:                  b"world",
                     26:                  "hello", 
                     27:                  'test');
                     28: 
                     29: var_dump(array_diff_assoc($array1, $array2));
                     30: var_dump(array_diff_assoc($array2, $array1));
                     31: 
                     32: echo "Done";
                     33: ?>
                     34: --EXPECTF--
                     35: *** Testing array_diff_assoc() : usage variations ***
                     36: array(3) {
                     37:   [0]=>
                     38:   string(1) "1"
                     39:   ["str1"]=>
                     40:   string(5) "hello"
                     41:   ["str2"]=>
                     42:   string(5) "world"
                     43: }
                     44: array(2) {
                     45:   [3]=>
                     46:   string(5) "hello"
                     47:   [4]=>
                     48:   string(4) "test"
                     49: }
                     50: Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>