/hphp/test/zend/good/ext/standard/tests/array/bug28974.php
PHP | 23 lines | 18 code | 2 blank | 3 comment | 0 complexity | ed733053751da8ff96ca032226e6df4b MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
- <?hh <<__EntryPoint>> function main(): void {
- $a = $b = $c = varray[0,1,2,3,4,5];
- print_r($a);
- // this is ok:
- print_r(array_slice($a,2,2147483645));
- // this is wrong:
- print_r(array_slice($a,2,2147483646));
- echo 'print_r(array_splice($a,2,1));'."\n";
- print_r(array_splice(inout $a, 2,1));
- echo "\$a is :";
- print_r($a);
- echo 'print_r(array_splice($b,2,2147483645));'."\n";
- print_r(array_splice(inout $b, 2,2147483645));
- echo "\$b is :";
- print_r($b);
- // this is wrong:
- echo 'print_r(array_splice($c,2,2147483646));'."\n";
- print_r(array_splice(inout $c, 2,2147483646));
- echo "\$c is :";
- print_r($c);
- }