PageRenderTime 58ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/hphp/test/slow/collection_classes/array_push.php

http://github.com/facebook/hiphop-php
PHP | 26 lines | 19 code | 7 blank | 0 comment | 2 complexity | 51d178c60605cc331034518b202cafee 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
  1. <?hh
  2. function main() {
  3. $elts = varray['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'];
  4. $v = Vector {'a', 'b', 'c', 'd'};
  5. var_dump(array_push(inout $v, 'e'));
  6. var_dump(array_push(inout $v, 'f', 'g', 'h'));
  7. var_dump($v == new Vector($elts));
  8. $s = Set {'a', 'b', 'c', 'd'};
  9. var_dump(array_push(inout $s, 'e'));
  10. var_dump(array_push(inout $s, 'f', 'g', 'h'));
  11. var_dump($s == new Set($elts));
  12. $m = Map{};
  13. array_push(inout $m, 'a');
  14. }
  15. <<__EntryPoint>>
  16. function main_array_push() {
  17. main();
  18. echo "Done\n";
  19. }