remove array_multisort and convert array_multisortN to use inout
[hiphop-php.git] / hphp / test / zend / good / ext / standard / tests / array / array_chunk_variation1.php
blob33d05344b12d4f3baa607c5cc891c19c169eecbe
1 <?hh
2 /* Prototype : proto array array_chunk(array $array, int $size [, bool $preserve_keys])
3 * Description: Split array into chunks
4 * Chunks an array into size large chunks.
5 * Source code: ext/standard/array.c
6 */
8 /*
9 * Testing array_chunk() function with unexpected values for 'array' argument
11 <<__EntryPoint>> function main(): void {
12 echo "*** Testing array_chunk() : usage variations ***\n";
14 // Initialise function arguments
15 $size = 10;
17 //get an unset variable
18 $unset_var = 10;
19 unset ($unset_var);
21 //array of values to iterate over
22 $values = array(
24 // int data
25 /*1*/ 0,
27 12345,
28 -2345,
30 // float data
31 /*5*/ 10.5,
32 -10.5,
33 10.5e10,
34 10.6E-10,
35 .5,
37 // null data
38 /*10*/ NULL,
39 null,
41 // boolean data
42 /*12*/ true,
43 false,
44 TRUE,
45 FALSE,
47 // empty data
48 /*16*/ "",
49 '',
51 // string data
52 /*18*/ "string",
53 'string',
55 // object data
56 /*20*/ new stdclass(),
60 $count = 1;
61 // loop through each element of the array for input
62 foreach($values as $value){
63 echo "\n-- Iteration $count --\n";
64 var_dump( array_chunk($value, $size) );
65 var_dump( array_chunk($value, $size, true) );
66 var_dump( array_chunk($value, $size, false) );
67 $count++;
70 echo "Done";