Home
last modified time | relevance | path

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

12

/PHP-8.0/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));
19 var_dump(array_slice(range(1, 3), 0, $a));
[all …]
H A Darray_slice_basic.phpt2 Test array_slice() function : basic functionality
6 * Test basic functionality of array_slice()
9 echo "*** Testing array_slice() : basic functionality ***\n";
17 // Calling array_slice() with all possible arguments
19 var_dump( array_slice($input, $offset, $length, $preserve_keys) );
21 // Calling array_slice() with mandatory arguments
23 var_dump( array_slice($input, $offset) );
28 *** 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
6 * Check position of internal array pointer after calling array_slice()
9 echo "*** Testing array_slice() : usage variations ***\n";
13 echo "\n-- Call array_slice() --\n";
14 var_dump($result = array_slice($input, 2));
24 *** Testing array_slice() : usage variations ***
26 -- Call array_slice() --
H A Darray_slice_variation11.phpt2 Test array_slice() function : usage variations - array has holes in buckets
6 * Check that results of array_slice are correct when there are holes in buckets caused by unset()
9 echo "*** Testing array_slice() : usage variations ***\n";
13 var_dump(array_slice($input, $offset, $length));
16 echo "\n-- Call array_slice() on array with string keys--\n";
23 echo "\n-- Call array_slice() on array with packed keys--\n";
35 *** Testing array_slice() : usage variations ***
37 -- Call array_slice() on array with string keys--
63 -- Call array_slice() on array with packed keys--
H A Darray_slice_variation8.phpt2 Test array_slice() function : usage variations - multidimensional arrays
6 * Test array_slice when passed
11 echo "*** Testing array_slice() : usage variations ***\n";
16 var_dump(array_slice($input, 1, 3));
19 var_dump(array_slice($input[2], 1, 2));
24 *** Testing array_slice() : usage variations ***
H A Darray_slice_variation9.phpt2 Test array_slice() function : usage variations - referenced variables
6 * Test array_slice() when:
11 echo "*** Testing array_slice() : usage variations ***\n";
19 var_dump(array_slice($input, 1, 2));
23 var_dump(array_slice($input, 1, 2, true));
28 *** Testing array_slice() : usage variations ***
H A Darray_slice_variation6.phpt2 Test array_slice() function : usage variations - pass different int values as $length arg
6 * Pass different integer values as $length argument to array_slice() to test behaviour
9 echo "*** Testing array_slice() : usage variations ***\n";
16 var_dump(array_slice($input, $offset, $i));
19 var_dump(array_slice($input, $offset, PHP_INT_MAX));
22 var_dump(array_slice($input, $offset, -PHP_INT_MAX));
27 *** Testing array_slice() : usage variations ***
H A Darray_slice_variation5.phpt2 Test array_slice() function : usage variations - Pass different integers as $offset argument
6 * Pass different integers as $offset argument to test how array_slice() behaves
9 echo "*** Testing array_slice() : usage variations ***\n";
15 var_dump(array_slice($input, $i));
18 var_dump(array_slice($input, PHP_INT_MAX));
21 var_dump(array_slice($input, -PHP_INT_MAX));
26 *** Testing array_slice() : usage variations ***
H A Darray_slice.phpt2 Testing array_slice() function
31 var_dump ( array_slice($sub_array, 1) );
32 var_dump ( array_slice($sub_array, 0) );
33 var_dump ( array_slice($sub_array, -2) );
38 var_dump ( array_slice($sub_array, 1, 3) );
39 var_dump ( array_slice($sub_array, 1, 0) );
40 var_dump ( array_slice($sub_array, 1, -3) );
41 var_dump ( array_slice($sub_array, 0, 3) );
42 var_dump ( array_slice($sub_array, 0, 0) );
43 var_dump ( array_slice($sub_array, 0, -3) );
[all …]
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
6 * Pass different data types as keys in an array to array_slice()
10 echo "*** Testing array_slice() : usage variations ***\n";
95 // loop through each element of $inputs to check the behavior of array_slice()
100 var_dump( array_slice($input, $offset, $length, true) );
102 var_dump( array_slice($input, $offset, $length, false) );
109 *** 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-8.0/Zend/tests/named_params/
H A Dinternal.phpt6 var_dump(array_slice(array: [1, 2, 3, 4, 5], offset: 2, length: 2));
7 var_dump(array_slice(length: 2, offset: 2, array: [1, 2, 3, 4, 5]));
9 var_dump(array_slice(array: ['a' => 0, 'b' => 1], offset: 1, preserve_keys: true));
10 var_dump(array_slice(['a' => 0, 'b' => 1], preserve_keys: true, offset: 1));
H A Dcall_user_func.phpt43 var_dump(call_user_func('array_slice', [1, 2, 3, 4, 5], length: 2));
48 var_dump(call_user_func('array_slice', [1, 2, 3, 4, 'x' => 5], 3, preserve_keys: true));
86 array_slice(): Argument #2 ($offset) not passed
/PHP-8.0/Zend/tests/
H A Dcall_user_func_array_array_slice_named_args.phpt2 call_user_func_array() + array_slice() + named arguments
5 call_user_func_array('func', array_slice(array: $a, 1, 2));
H A Dbug74810.phpt7 var_dump(array_slice(func_get_args(), 1));
10 var_dump(array_slice(func_get_args(), 5));
H A Dbug72598.phpt2 Bug #72598 (Reference is lost after array_slice())
13 $a = array_slice($args, 0, 1);
H A Dbug72598_2.phpt2 Bug #72598.2 (Reference is lost after array_slice())
16 $a = array_slice($args, 0, 1);
/PHP-8.0/ext/opcache/tests/
H A Dbug81272.phpt2 Bug #81272: Segfault in var[] after array_slice with JIT
12 $newPages = array_slice([], 0, 0);
/PHP-8.0/Zend/tests/nullsafe_operator/
H A D013.phpt33 dump_error(fn() => array_slice($foo?->foo(), 0));
34 dump_error(fn() => array_slice(['foo'], $foo?->foo()));
35 dump_error(fn() => array_slice(['foo'], 0, $foo?->foo()));
57 string(69) "array_slice(): Argument #1 ($array) must be of type array, null given"
/PHP-8.0/ext/pdo/tests/
H A Dgh8626.phpt32 var_dump(array_slice($errorInfo, 0, 3)); // odbc, dblib
39 var_dump(array_slice($errorInfo, 0, 3)); // odbc, dblib
/PHP-8.0/sapi/cli/tests/
H A Dargv_mb_bug77111.phpt25 file_put_contents($argv_fl, "<?php file_put_contents('$out_fl', implode(' ', array_slice(\$argv, 1)…
/PHP-8.0/sapi/phpdbg/
H A Dcreate-test.php57 $cmdargv = implode(" ", array_map("escapeshellarg", array_slice($real_argv, 1)));
/PHP-8.0/ext/standard/tests/general_functions/
H A Dproc_open_array.phpt63 $cmd = [$php, '-r', 'var_export(array_slice($argv, 1));', '--', ...$args];

Completed in 26 milliseconds

12