PageRenderTime 47ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/hphp/test/slow/async/func_get_arg.php

http://github.com/facebook/hiphop-php
PHP | 27 lines | 23 code | 4 blank | 0 comment | 2 complexity | 5c0212627052b18d6a13d625c8854a57 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 block() {
  3. return RescheduleWaitHandle::create(
  4. RescheduleWaitHandle::QUEUE_NO_PENDING_IO,
  5. 1,
  6. );
  7. };
  8. async function num() {
  9. var_dump(func_num_args());
  10. await block();
  11. var_dump(func_num_args());
  12. }
  13. async function arg() {
  14. for ($i = 0; $i < func_num_args(); ++$i) {
  15. var_dump(func_get_arg($i));
  16. }
  17. await block();
  18. for ($i = 0; $i < func_num_args(); ++$i) {
  19. var_dump(func_get_arg($i));
  20. }
  21. }
  22. HH\Asio\join(num("a", "b", "c"));
  23. HH\Asio\join(arg("e", "f"));