Home
last modified time | relevance | path

Searched refs:array_slice (Results 1 – 22 of 22) sorted by relevance

/PHP-5.5/ext/standard/tests/array/
H A Darray_slice_variation1.phpt2 Test array_slice() - Third parameter (NULL vs 0)
6 var_dump(array_slice(range(1, 3), 0, NULL, 1));
7 var_dump(array_slice(range(1, 3), 0, 0, 1));
8 var_dump(array_slice(range(1, 3), 0, NULL));
9 var_dump(array_slice(range(1, 3), 0, 0));
11 var_dump(array_slice(range(1, 3), -1, 0));
12 var_dump(array_slice(range(1, 3), -1, 0, 1));
13 var_dump(array_slice(range(1, 3), -1, NULL));
14 var_dump(array_slice(range(1, 3), -1, NULL, 1));
18 var_dump(array_slice(range(1, 3), 0, $a));
[all …]
H A Darray_slice_error.phpt2 Test array_slice() function : error conditions - Pass incorrect number of args
11 * Pass an incorrect number of arguments to array_slice() to test behaviour
14 echo "*** Testing array_slice() : error conditions ***\n";
16 //Test array_slice with one more than the expected number of arguments
23 var_dump( array_slice($input, $offset, $length, $preserve_keys, $extra_arg) );
25 // Testing array_slice with one less than the expected number of arguments
27 var_dump( array_slice($input) );
32 *** Testing array_slice() : error conditions ***
34 -- Testing array_slice() function with more than expected no. of arguments --
36 Warning: array_slice() expects at most 4 parameters, 5 given in %s on line %d
[all …]
H A Darray_slice_variation11.phpt2 Test array_slice() function : usage variations - Pass different data types as $input arg
11 * Pass different arguments as $input argument to array_slice() to test behaviour
14 echo "*** Testing array_slice() : usage variations ***\n";
88 // loop through each element of $inputs to check the behavior of array_slice()
92 var_dump( array_slice($input, $offset) );
102 *** Testing array_slice() : usage variations ***
126 Warning: array_slice() expects parameter 1 to be array, double given in %s on line %d
151 Warning: array_slice() expects parameter 1 to be array, null given in %s on line %d
156 Warning: array_slice() expects parameter 1 to be array, null given in %s on line %d
215 Warning: array_slice() expects parameter 1 to be array, null given in %s on line %d
[all …]
H A Darray_slice_basic.phpt2 Test array_slice() function : basic functionality
5 /* Prototype : array array_slice(array $input, int $offset [, int $length [, bool $preserve_keys]])
11 * Test basic functionality of array_slice()
14 echo "*** Testing array_slice() : basic functionality ***\n";
22 // Calling array_slice() with all possible arguments
24 var_dump( array_slice($input, $offset, $length, $preserve_keys) );
26 // Calling array_slice() with mandatory arguments
28 var_dump( array_slice($input, $offset) );
34 *** Testing array_slice() : basic functionality ***
H A Dbug41686.phpt2 Bug #41686 (Omitting length param in array_slice not possible)
9 array_slice($a, 1),
10 array_slice($a, 1, 2, TRUE),
11 array_slice($a, 1, NULL, TRUE),
12 array_slice($b, 1),
13 array_slice($b, 1, 2, TRUE),
14 array_slice($b, 1, NULL, TRUE)
H A Darray_slice_variation10.phpt2 Test array_slice() function : usage variations - position of internal array pointer
5 /* Prototype : array array_slice(array $input, int $offset [, int $length [, bool $preserve_keys]])
11 * Check position of internal array pointer after calling array_slice()
14 echo "*** Testing array_slice() : usage variations ***\n";
18 echo "\n-- Call array_slice() --\n";
19 var_dump($result = array_slice($input, 2));
30 *** Testing array_slice() : usage variations ***
32 -- Call array_slice() --
H A Darray_slice_variation8.phpt2 Test array_slice() function : usage variations - multidimensional arrays
5 /* Prototype : array array_slice(array $input, int $offset [, int $length [, bool $preserve_keys]])
11 * Test array_slice when passed
16 echo "*** Testing array_slice() : usage variations ***\n";
21 var_dump(array_slice($input, 1, 3));
24 var_dump(array_slice($input[2], 1, 2));
30 *** Testing array_slice() : usage variations ***
H A Darray_slice_variation9.phpt2 Test array_slice() function : usage variations - referenced variables
5 /* Prototype : array array_slice(array $input, int $offset [, int $length [, bool $preserve_keys]])
11 * Test array_slice() when:
16 echo "*** Testing array_slice() : usage variations ***\n";
24 var_dump(array_slice($input, 1, 2));
28 var_dump(array_slice($input, 1, 2, true));
34 *** Testing array_slice() : usage variations ***
H A Darray_slice_variation2.phpt2 Test array_slice() function : usage variations - Pass different data types as $offset arg
13 * Pass different data types as $offset argument to array_slice() to test behaviour
16 echo "*** Testing array_slice() : usage variations ***\n";
84 // loop through each element of $inputs to check the behavior of array_slice()
88 var_dump( array_slice($input_array, $input) );
98 *** Testing array_slice() : usage variations ***
260 Warning: array_slice() expects parameter 2 to be long, string given in %s on line %d
265 Warning: array_slice() expects parameter 2 to be long, string given in %s on line %d
270 Warning: array_slice() expects parameter 2 to be long, array given in %s on line %d
275 Warning: array_slice() expects parameter 2 to be long, string given in %s on line %d
[all …]
H A Darray_slice_variation6.phpt2 Test array_slice() function : usage variations - pass different int values as $length arg
5 /* Prototype : array array_slice(array $input, int $offset [, int $length [, bool $preserve_keys]])
11 * Pass different integer values as $length argument to array_slice() to test behaviour
14 echo "*** Testing array_slice() : usage variations ***\n";
21 var_dump(array_slice($input, $offset, $i));
24 var_dump(array_slice($input, $offset, PHP_INT_MAX));
27 var_dump(array_slice($input, $offset, -PHP_INT_MAX));
33 *** Testing array_slice() : usage variations ***
H A Darray_slice.phpt2 Testing array_slice() function
25 array_slice();
29 array_slice($var_array);
33 array_slice($var_array, 2, 4, true, 3);
37 array_slice($num, 2);
41 array_slice($str, 2);
51 var_dump ( array_slice($sub_array, 1) );
52 var_dump ( array_slice($sub_array, 0) );
53 var_dump ( array_slice($sub_array, -2) );
58 var_dump ( array_slice($sub_array, 1, 3) );
[all …]
H A Darray_slice_variation5.phpt2 Test array_slice() function : usage variations - Pass different integers as $offset argument
5 /* Prototype : array array_slice(array $input, int $offset [, int $length [, bool $preserve_keys]])
11 * Pass different integers as $offset argument to test how array_slice() behaves
14 echo "*** Testing array_slice() : usage variations ***\n";
20 var_dump(array_slice($input, $i));
23 var_dump(array_slice($input, PHP_INT_MAX));
26 var_dump(array_slice($input, -PHP_INT_MAX));
32 *** Testing array_slice() : usage variations ***
H A Darray_slice_variation4.phpt2 Test array_slice() function : usage variations - Pass different data types as $preserve_keys arg
5 /* Prototype : array array_slice(array $input, int $offset [, int $length [, bool $preserve_keys]])
11 * Pass different data types as $preserve_keys argument to array_slice() to test behaviour
14 echo "*** Testing array_slice() : usage variations ***\n";
84 // loop through each element of $inputs to check the behavior of array_slice()
88 var_dump( array_slice($input_array, $offset, $length, $input) );
96 *** Testing array_slice() : usage variations ***
270 Warning: array_slice() expects parameter 4 to be boolean, array given in %s on line %d
305 Warning: array_slice() expects parameter 4 to be boolean, object given in %s on line %d
H A Darray_slice_variation3.phpt2 Test array_slice() function : usage variations - Pass different data types as $length arg
7 /* Prototype : array array_slice(array $input, int $offset [, int $length [, bool $preserve_keys]])
13 * Pass different data types as $length argument to array_slice to test behaviour
16 echo "*** Testing array_slice() : usage variations ***\n";
74 // loop through each element of $inputs to check the behavior of array_slice
78 var_dump( array_slice($input_array, $offset, $input) );
86 *** Testing array_slice() : usage variations ***
H A Dbug43541.phpt7 var_dump(array_slice($arr, 0, (float)2));
8 var_dump(array_slice($arr, 0, (int)2));
H A Darray_slice_variation7.phpt2 Test array_slice() function : usage variations - different data types as keys in an array
5 /* Prototype : array array_slice(array $input, int $offset [, int $length [, bool $preserve_keys]])
11 * Pass different data types as keys in an array to array_slice()
15 echo "*** Testing array_slice() : usage variations ***\n";
100 // loop through each element of $inputs to check the behavior of array_slice()
105 var_dump( array_slice($input, $offset, $length, true) );
107 var_dump( array_slice($input, $offset, $length, false) );
115 *** Testing array_slice() : usage variations ***
H A Dbug28974.phpt8 print_r(array_slice($a,2,2147483645));
11 print_r(array_slice($a,2,2147483646));
/PHP-5.5/ext/standard/
H A Dphp_array.h66 PHP_FUNCTION(array_slice);
H A Darray.c2127 PHP_FUNCTION(array_slice) in PHP_FUNCTION() argument
H A Dbasic_functions.c3324 PHP_FE(array_slice, arginfo_array_slice)
/PHP-5.5/ext/oci8/tests/
H A Ddbmsoutput.phpt84 $res = array_merge($res, array_slice($lines, 0, $numlines));
/PHP-5.5/
H A DNEWS6961 - Fixed bug #44046 (crash inside array_slice() function with an invalid by-ref offset). (Ilia)
7351 - Fixed bug #41686 (Omitting length param in array_slice not possible). (Ilia)
10060 - Added new boolean (fourth) parameter to array_slice() that turns on the

Completed in 73 milliseconds