/hphp/test/slow/ext_array/array_shift.php

http://github.com/facebook/hiphop-php · PHP · 35 lines · 29 code · 6 blank · 0 comment · 0 complexity · 89679742c9deabcfc5983c9bb748af8d MD5 · raw file

  1. <?hh
  2. function a() {
  3. $input = darray["a" => 1, "b" => 2];
  4. array_shift(inout $input);
  5. var_dump($input);
  6. }
  7. function b() {
  8. $input = darray["a" => 1, 23 => 2];
  9. array_shift(inout $input);
  10. var_dump($input);
  11. }
  12. function c() {
  13. $input = darray["a" => 1, -23 => 2];
  14. array_shift(inout $input);
  15. var_dump($input);
  16. }
  17. function d() {
  18. $input = varray["orange", "banana", "apple", "raspberry"];
  19. $fruit = array_shift(inout $input);
  20. var_dump($input);
  21. var_dump($fruit);
  22. }
  23. <<__EntryPoint>>
  24. function main_array_shift() {
  25. a();
  26. b();
  27. c();
  28. d();
  29. }