remove array_multisort and convert array_multisortN to use inout
[hiphop-php.git] / hphp / test / zend / good / ext / standard / tests / array / array_uintersect_assoc_variation4.php
blob431f5aaffe07bcee4d5d6b0a9a3cc41ccb86beb0
1 <?hh
2 /* Prototype : array array_uintersect_assoc(array arr1, array arr2 [, array ...], callback data_compare_func)
3 * Description: U
4 * Source code: ext/standard/array.c
5 * Alias to functions:
6 */
8 // define some classes
9 class classWithToString
11 public function __toString() {
12 return "Class A object";
16 class classWithoutToString
19 include('compare_function.inc');
20 <<__EntryPoint>> function main(): void {
21 echo "*** Testing array_uintersect_assoc() : usage variation ***\n";
23 // Initialise function arguments not being substituted (if any)
24 $arr1 = array(1, 2);
25 $arr2 = array(1, 2);
27 $data_compare_function = 'compare_function';
29 //get an unset variable
30 $unset_var = 10;
31 unset ($unset_var);
33 // heredoc string
34 $heredoc = <<<EOT
35 hello world
36 EOT;
38 // add arrays
39 $index_array = array (1, 2, 3);
40 $assoc_array = array ('one' => 1, 'two' => 2);
42 //array of values to iterate over
43 $inputs = array(
45 // int data
46 'int 0' => 0,
47 'int 1' => 1,
48 'int 12345' => 12345,
49 'int -12345' => -2345,
51 // float data
52 'float 10.5' => 10.5,
53 'float -10.5' => -10.5,
54 'float 12.3456789000e10' => 12.3456789000e10,
55 'float -12.3456789000e10' => -12.3456789000e10,
56 'float .5' => .5,
58 // null data
59 'uppercase NULL' => NULL,
60 'lowercase null' => null,
62 // boolean data
63 'lowercase true' => true,
64 'lowercase false' =>false,
65 'uppercase TRUE' =>TRUE,
66 'uppercase FALSE' =>FALSE,
68 // empty data
69 'empty string DQ' => "",
70 'empty string SQ' => '',
72 // string data
73 'string DQ' => "string",
74 'string SQ' => 'string',
75 'mixed case string' => "sTrInG",
76 'heredoc' => $heredoc,
78 // object data
79 'instance of classWithToString' => new classWithToString(),
80 'instance of classWithoutToString' => new classWithoutToString(),
82 // undefined data
83 'undefined var' => @$undefined_var,
85 // unset data
86 'unset var' => @$unset_var,
89 // loop through each element of the array for ...
91 foreach($inputs as $key =>$value) {
92 echo "\n--$key--\n";
93 var_dump( array_uintersect_assoc($arr1, $arr2, $value, $data_compare_function ) );
96 echo "===DONE===\n";