1--TEST--
2Test array_slice() - Third parameter (NULL vs 0)
3--FILE--
4<?php
5
6var_dump(array_slice(range(1, 3), 0, NULL, 1));
7var_dump(array_slice(range(1, 3), 0, 0, 1));
8var_dump(array_slice(range(1, 3), 0, NULL));
9var_dump(array_slice(range(1, 3), 0, 0));
10
11var_dump(array_slice(range(1, 3), -1, 0));
12var_dump(array_slice(range(1, 3), -1, 0, 1));
13var_dump(array_slice(range(1, 3), -1, NULL));
14var_dump(array_slice(range(1, 3), -1, NULL, 1));
15
16
17$a = 'foo';
18var_dump(array_slice(range(1, 3), 0, $a));
19var_dump(array_slice(range(1, 3), 0, $a));
20var_dump($a);
21
22?>
23
24--EXPECTF--
25array(3) {
26  [0]=>
27  int(1)
28  [1]=>
29  int(2)
30  [2]=>
31  int(3)
32}
33array(0) {
34}
35array(3) {
36  [0]=>
37  int(1)
38  [1]=>
39  int(2)
40  [2]=>
41  int(3)
42}
43array(0) {
44}
45array(0) {
46}
47array(0) {
48}
49array(1) {
50  [0]=>
51  int(3)
52}
53array(1) {
54  [2]=>
55  int(3)
56}
57array(0) {
58}
59array(0) {
60}
61string(3) "foo"
62