xref: /PHP-7.4/ext/standard/tests/array/bug43541.phpt (revision 9a4de086)
1--TEST--
2Bug #43541 (length parameter omitted or not does not work when casted to float)
3--FILE--
4<?php
5$arr = array(1, 2, 3, 4, 5, 6);
6
7var_dump(array_slice($arr, 0, (float)2));
8var_dump(array_slice($arr, 0, (int)2));
9?>
10--EXPECT--
11array(2) {
12  [0]=>
13  int(1)
14  [1]=>
15  int(2)
16}
17array(2) {
18  [0]=>
19  int(1)
20  [1]=>
21  int(2)
22}
23