/usr/share/php/tests/PHP_Compat/tests/function/array_slice.phpt is in php-compat 1.6.0a3-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | --TEST--
Function -- array_slice
--FILE--
<?php
require_once 'PHP/Compat/Function/array_slice.php';
$input = array("a", "b", "c", "d", "e");
var_dump(array_slice($input, 2, -1));
var_dump(array_slice($input, 2, -1, true));
var_dump(array_slice($input, 0));
var_dump(array_slice($input, -2));
var_dump(array_slice($input, -2, true));
var_dump(array_slice($input, -2, -1, true));
?>
--EXPECT--
array(2) {
[0]=>
string(1) "c"
[1]=>
string(1) "d"
}
array(2) {
[2]=>
string(1) "c"
[3]=>
string(1) "d"
}
array(5) {
[0]=>
string(1) "a"
[1]=>
string(1) "b"
[2]=>
string(1) "c"
[3]=>
string(1) "d"
[4]=>
string(1) "e"
}
array(2) {
[0]=>
string(1) "d"
[1]=>
string(1) "e"
}
array(1) {
[0]=>
string(1) "d"
}
array(1) {
[3]=>
string(1) "d"
}
|