import zend standard tests
[hiphop-php.git] / hphp / test / zend / bad / ext-standard-array / array_map_object2.php
blob30f410d71e7f18ce4443c98723a32b8ecfae3b09
1 <?php
2 /* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
3 * Description: Applies the callback to the elements of the given arrays
4 * Source code: ext/standard/array.c
5 */
7 /*
8 * Testing array_map() for following object functionalities:
9 * 1) non-existent class
10 * 2) existent class and non-existent function
12 echo "*** Testing array_map() : with non-existent class and method ***\n";
14 class SimpleClass
16 public $var1 = 1;
17 public function square($n) {
18 return $n * $n;
20 public static function cube($n) {
21 return $n * $n * $n;
25 echo "-- with non-existent class --\n";
26 var_dump( array_map(array('non-existent', 'square'), array(1, 2)) );
28 echo "-- with existent class and non-existent method --\n";
29 var_dump( array_map(array('SimpleClass', 'non-existent'), array(1, 2)) );
31 echo "Done";