remove array_multisort and convert array_multisortN to use inout
[hiphop-php.git] / hphp / test / zend / good / ext / standard / tests / array / array_diff_variation4.php
blob12d1900d4255805989eee746523f028b40d04279
1 <?hh
2 /* Prototype : array array_diff(array $arr1, array $arr2 [, array ...])
3 * Description: Returns the entries of $arr1 that have values which are not
4 * present in any of the others arguments.
5 * Source code: ext/standard/array.c
6 */
8 /*
9 * Test how array_diff() compares indexed arrays containing different
10 * data types as values in place of $arr2
12 <<__EntryPoint>> function main(): void {
13 echo "*** Testing array_diff() : usage variations ***\n";
15 // Initialise function arguments not being substituted (if any)
16 $array = array(1, 2);
18 //get an unset variable
19 $unset_var = 10;
20 unset ($unset_var);
22 //get heredoc
23 $heredoc = <<<END
24 This is a heredoc
25 END;
27 //array of values to iterate over
28 $values = array(
30 /*1*/"empty array" => array(),
32 /*2*/
33 "int" => array(
34 // int data
37 12345,
38 -2345),
40 /*3*/
41 "float" => array(
42 // float data
43 10.5,
44 -10.5,
45 12.3456789000e10,
46 12.3456789000E-10,
47 .5),
49 /*4*/
50 "null" => array(
51 // null data
52 NULL,
53 null),
55 /*5*/
56 "boolean" => array(
57 // boolean data
58 true,
59 false,
60 TRUE,
61 FALSE),
63 /*6*/
64 "empty" => array(
65 // empty data
66 "",
67 ''),
69 /*7*/
70 "string" => array(
71 // string data
72 "string",
73 'string',
74 $heredoc),
76 /*8*/
77 "binary" => array(
78 // binary data
79 b"binary",
80 (binary)"binary"),
82 /*9*/
83 "undefined" => array(
84 // undefined data
85 @$undefined_var),
87 /*10*/
88 "unset" => array(
89 // unset data
90 @$unset_var)
93 // loop through each element of the array for $arr2
94 $iterator = 1;
95 foreach($values as $value) {
96 echo "\n Iteration: $iterator \n";
97 var_dump( array_diff($array, $value) );
98 $iterator++;
101 echo "Done";