import zend standard tests
[hiphop-php.git] / hphp / test / zend / good / ext-standard-array / array_uintersect_assoc_variation1.php
blob93dd6e665f2f51cf05cf2d103b66e06d83e9d15b
1 <?php
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 echo "*** Testing array_uintersect_assoc() : usage variation ***\n";
10 // Initialise function arguments not being substituted (if any)
11 $arr2 = array(1, 2);
13 include('compare_function.inc');
14 $data_compare_function = 'compare_function';
16 //get an unset variable
17 $unset_var = 10;
18 unset ($unset_var);
20 // define some classes
21 class classWithToString
23 public function __toString() {
24 return "Class A object";
28 class classWithoutToString
32 // heredoc string
33 $heredoc = <<<EOT
34 hello world
35 EOT;
37 // add arrays
38 $index_array = array (1, 2, 3);
39 $assoc_array = array ('one' => 1, 'two' => 2);
41 //array of values to iterate over
42 $inputs = array(
44 // int data
45 'int 0' => 0,
46 'int 1' => 1,
47 'int 12345' => 12345,
48 'int -12345' => -2345,
50 // float data
51 'float 10.5' => 10.5,
52 'float -10.5' => -10.5,
53 'float 12.3456789000e10' => 12.3456789000e10,
54 'float -12.3456789000e10' => -12.3456789000e10,
55 'float .5' => .5,
57 // null data
58 'uppercase NULL' => NULL,
59 'lowercase null' => null,
61 // boolean data
62 'lowercase true' => true,
63 'lowercase false' =>false,
64 'uppercase TRUE' =>TRUE,
65 'uppercase FALSE' =>FALSE,
67 // empty data
68 'empty string DQ' => "",
69 'empty string SQ' => '',
71 // string data
72 'string DQ' => "string",
73 'string SQ' => 'string',
74 'mixed case string' => "sTrInG",
75 'heredoc' => $heredoc,
77 // object data
78 'instance of classWithToString' => new classWithToString(),
79 'instance of classWithoutToString' => new classWithoutToString(),
81 // undefined data
82 'undefined var' => @$undefined_var,
84 // unset data
85 'unset var' => @$unset_var,
88 // loop through each element of the array for arr1
90 foreach($inputs as $key =>$value) {
91 echo "\n--$key--\n";
92 var_dump( array_uintersect_assoc($value, $arr2, $data_compare_function) );
96 ===DONE===