/hphp/test/zend/good/ext/standard/tests/array/bug28974.php

http://github.com/facebook/hiphop-php · PHP · 23 lines · 18 code · 2 blank · 3 comment · 0 complexity · ed733053751da8ff96ca032226e6df4b MD5 · raw file

  1. <?hh <<__EntryPoint>> function main(): void {
  2. $a = $b = $c = varray[0,1,2,3,4,5];
  3. print_r($a);
  4. // this is ok:
  5. print_r(array_slice($a,2,2147483645));
  6. // this is wrong:
  7. print_r(array_slice($a,2,2147483646));
  8. echo 'print_r(array_splice($a,2,1));'."\n";
  9. print_r(array_splice(inout $a, 2,1));
  10. echo "\$a is :";
  11. print_r($a);
  12. echo 'print_r(array_splice($b,2,2147483645));'."\n";
  13. print_r(array_splice(inout $b, 2,2147483645));
  14. echo "\$b is :";
  15. print_r($b);
  16. // this is wrong:
  17. echo 'print_r(array_splice($c,2,2147483646));'."\n";
  18. print_r(array_splice(inout $c, 2,2147483646));
  19. echo "\$c is :";
  20. print_r($c);
  21. }