/PHP-5.3/ext/standard/tests/array/ |
H A D | array_values_variation7.phpt | 5 /* Prototype : array array_values(array $input) 6 * Description: Return just the values from the input array 12 * and is not dependant on the \$input argument's keys 18 $input = array(3 => 'three', 2 => 'two', 1 => 'one', 0 => 'zero'); 20 echo "\n-- \$input argument: --\n"; 21 var_dump($input); 24 var_dump(array_values($input)); 32 -- $input argument: --
|
H A D | array_sum_basic.phpt | 5 /* Prototype : mixed array_sum(array &input) 13 $input = array(1, 2, 3, 4, 5); 15 var_dump( array_sum($input) ); 18 $input = array(1.0, 2.2, 3.4, 4.6); 20 var_dump( array_sum($input) ); 23 $input = array(1, 2.3, 4, 0.6, 10); 25 var_dump( array_sum($input) );
|
H A D | array_filter_variation8.phpt | 17 $input = array(0, 1, -1, 10, 100, 1000, 'Hello', null, true); 21 function callback1($input) 26 var_dump( array_filter($input, 'callback1') ); 29 function callback2($input) 34 var_dump( array_filter($input, 'callback2') ); 37 function callback3($input) 42 var_dump( array_filter($input, 'callback3') ); 45 function callback4($input) 50 var_dump( array_filter($input, 'callback4') ); 53 function callback5($input) [all …]
|
H A D | array_change_key_case_variation6.phpt | 5 /* Prototype : array array_change_key_case(array $input [, int $case]) 16 $input = array('English' => array('one' => 1, 'two' => 2, 'three' => 3), 20 echo "\n-- Pass a two-dimensional array as \$input argument --\n"; 21 var_dump(array_change_key_case($input, CASE_UPPER)); 23 echo "\n-- Pass a sub-arry as \$input argument --\n"; 24 var_dump(array_change_key_case($input['English'], CASE_UPPER)); 32 -- Pass a two-dimensional array as $input argument -- 63 -- Pass a sub-arry as $input argument --
|
H A D | array_sum_variation6.phpt | 5 /* Prototype : mixed array_sum(array $input) 11 * Testing array_sum() with associative array as 'input' argument 17 $input = array(0 => 1, 1 => 10, 2 => 0, 3 => -2, 4 => 23.56); 19 var_dump( array_sum($input) ); 22 $input = array('a' => 20, "b" => 50, 'c' => 0, 'd' => -30, "e" => 100); 24 var_dump( array_sum($input) );
|
H A D | array_unique_variation6.phpt | 5 /* Prototype : array array_unique(array $input) 15 echo "*** Testing array_unique() : array with reference variables for \$input argument ***\n"; 22 // input array containing elements as reference variables 23 $input = array( 32 var_dump( array_unique($input, SORT_STRING) ); 37 *** Testing array_unique() : array with reference variables for $input argument ***
|
H A D | array_unique_variation8.phpt | 5 /* Prototype : array array_unique(array $input) 12 * two dimensional arrays for $input argument. 15 echo "*** Testing array_unique() : two dimensional array for \$input argument ***\n"; 18 $input = array( 25 var_dump( array_unique($input, SORT_STRING) ); 30 *** Testing array_unique() : two dimensional array for $input argument ***
|
H A D | array_values_variation6.phpt | 7 /* Prototype : array array_values(array $input) 8 * Description: Return just the values from the input array 24 echo "\n-- \$input is an array made up of referenced variables: --\n"; 25 $input = array(&$val1, &$val2, &$val3); 26 var_dump($result1 = array_values($input)); 32 echo "\n-- Pass \$input argument by reference --\n"; 42 -- $input is an array made up of referenced variables: -- 61 -- Pass $input argument by reference --
|
H A D | array_rand_variation5.phpt | 5 /* Prototype : mixed array_rand(array $input [, int $num_req]) 12 * various invalid values are passed to the 'input' and 'req_num' 19 $input = array( 29 var_dump( array_rand($input) ); // with default $num_req value 31 var_dump( array_rand($input, 1) ); // with valid $num_req value 35 var_dump( array_rand($input, 0) ); // with $num_req=0 37 var_dump( array_rand($input, -1) ); // with $num_req=-1 39 var_dump( array_rand($input, -2) ); // with $num_req=-2 40 echo"\n-- With num_req more than number of members in 'input' array --\n"; 41 var_dump( array_rand($input, 13) ); // with $num_req=13 [all …]
|
H A D | array_rand_variation6.phpt | 2 Test array_rand() function : usage variation - with heredoc string as key in the 'input' array 5 /* Prototype : mixed array_rand(array $input [, int $num_req]) 11 * Test behaviour of array_rand() when keys of the 'input' array is heredoc string 14 echo "*** Testing array_rand() : with keys of input array as heredoc strings ***\n"; 44 $input = array( 55 var_dump( array_rand($input) ); 58 var_dump( array_rand($input, 1) ); 61 var_dump( array_rand($input, 3) ); 64 var_dump( array_rand($input, 6) ); 70 \*\*\* Testing array_rand\(\) : with keys of input array as heredoc strings \*\*\*
|
H A D | array_pad_variation4.phpt | 5 /* Prototype : array array_pad(array $input, int $pad_size, mixed $pad_value) 6 * Description: Returns a copy of input array padded with pad_value to size pad_size 13 * The $input and $pad_size arguments passed are fixed values. 18 // initialize the $input and $pad_size argument 19 $input = array(1, 2, 3); 25 var_dump( array_pad($input, $pad_size, $binary) ); // positive 'pad_size' 26 var_dump( array_pad($input, -$pad_size, $binary) ); // negative 'pad_size'
|
H A D | array_rand_basic2.phpt | 2 Test array_rand() function : basic functionality - with associative array for 'input' argument 5 /* Prototype : mixed array_rand(array $input [, int $num_req]) 11 * Test array_rand() when associative array is passed to 'input' argument 17 // Initialise the 'input' and 'num_req' variables 18 $input = array( 28 var_dump( array_rand($input,$num_req) ); 32 var_dump( array_rand($input) );
|
H A D | array_filter_error.phpt | 5 /* Prototype : array array_filter(array $input [, callback $callback]) 16 $input = array(0, 1, 2, 3, 5); 18 * Prototype : bool odd(array $input) 19 * Parameters : $input - array for which each elements should be checked into the function 21 * Description : Function takes array as input and checks for its each elements. 23 function odd($input) 25 return ($input % 2 != 0); 31 var_dump( array_filter($input, "odd", $extra_arg) ); 35 var_dump( array_filter($input, "even") );
|
H A D | array_walk_object1.phpt | 5 /* Prototype : bool array_walk(array $input, string $funcname [, mixed $userdata]) 11 * Pasing object in place of 'input' argument to test object functionatlity 18 * Parameters : $value - values in given input array 19 * $key - keys in given input array 45 // object for 'input' argument 46 $input = new MyClass(10); 48 var_dump( array_walk($input, "callback", 1));
|
H A D | array_walk_recursive_object1.phpt | 5 /* Prototype : bool array_walk_recursive(array $input, string $funcname [, mixed $userdata]) 10 /* Passing object in place of an 'input' argument to test object functionality 16 * Parameters : $value - values in given input array 17 * $key - keys in given input array 43 // object for 'input' argument 44 $input = new MyClass(10); 46 var_dump( array_walk_recursive($input, "callback", 1));
|
H A D | array_sum_variation5.phpt | 5 /* Prototype : mixed array_sum(array $input) 11 * Testing array_sum() with 'input' having reference variables as elements 21 // input array containing elements as reference variables 22 $input = array( 30 var_dump( array_sum($input) );
|
H A D | array_filter_variation4.phpt | 5 /* Prototype : array array_filter(array $input [, callback $callback]) 21 $input = array(0, -1, 2, 3.4E-3, 'hello', "value", "key" => 4, 'null' => NULL); 29 var_dump( array_filter($input, "callback1") ); 32 function callback2($input) 36 var_dump( array_filter($input, "callback2") ); 44 var_dump( array_filter($input, "callback3") ); 47 function callback4($input) 49 if($input > 0 ) { 57 var_dump( array_filter($input, "callback4") );
|
H A D | array_unique_variation5.phpt | 5 /* Prototype : array array_unique(array $input) 15 echo "*** Testing array_unique() : array with duplicate keys for \$input argument ***\n"; 18 $input = array( 1 => "one", 2 => "two", 2 => "2", 3 => "three", 1 => "1", "1", "2"); 19 var_dump( array_unique($input) ); 24 *** Testing array_unique() : array with duplicate keys for $input argument ***
|
H A D | array_unique_variation7.phpt | 5 /* Prototype : array array_unique(array $input) 14 echo "*** Testing array_unique() : array with binary data for \$input argument ***\n"; 17 $input = array( b"1", b"hello", "world", "str1" => "hello", "str2" => "world"); 19 var_dump( array_unique($input) ); 24 *** Testing array_unique() : array with binary data for $input argument ***
|
H A D | array_rand_basic1.phpt | 5 /* Prototype : mixed array_rand(array $input [, int $num_req]) 11 * Test array_rand() when array with default keys is passed to 'input' argument 17 // Initialise the 'input' and 'num_req' variables 18 $input = array(10, 20, 30, 40, 50, 60, 70); 23 var_dump( array_rand($input,$num_req) ); 27 var_dump( array_rand($input) );
|
H A D | array_values_variation5.phpt | 5 /* Prototype : array array_values(array $input) 6 * Description: Return just the values from the input array 16 $input = array ('one' => 'un', 'two' => 'deux', 'three' => 'trois'); 19 var_dump($result = array_values($input)); 24 echo key($input) . " => " . current ($input) . "\n";
|
H A D | array_walk_error2.phpt | 5 /* Prototype : bool array_walk(array $input, string $funcname [, mixed $userdata]) 13 $input = array(1); 25 var_dump( array_walk($input, "callback1") ); 26 var_dump( array_walk($input, "callback2", 4) ); 29 var_dump( @array_walk($input, "callback1") ); 30 var_dump( @array_walk($input, "callback2", 4) ); 33 var_dump( array_walk($input, "callback1", 20, 10) );
|
H A D | array_walk_variation5.phpt | 2 Test array_walk() function : usage variations - 'input' argument containing reference variables 5 /* Prototype : bool array_walk(array $input, string $funcname [, mixed $userdata]) 21 // 'input' array containing references to above variables 22 $input = array(&$value1, &$value2, -35, &$value3, 0, &$value4); 26 * Parameters : $value - values in given input array 27 * $key - keys in given input array 39 var_dump( array_walk($input, "callback"));
|
/PHP-5.3/ext/spl/tests/ |
H A D | heap_005.phpt | 2 SPL: SplMinHeap: large unordered input iterated 5 $input = range(1,100); 6 shuffle($input); 10 foreach($input as $i) {
|
H A D | heap_006.phpt | 2 SPL: SplMaxHeap: large unordered input iterated 5 $input = range(1,100); 6 shuffle($input); 10 foreach($input as $i) {
|