020.phpt 640 B

12345678910111213141516171819202122232425262728293031323334
  1. --TEST--
  2. func_get_arg() invalid usage
  3. --FILE--
  4. <?php
  5. var_dump(func_get_arg(1,2,3));
  6. var_dump(func_get_arg(1));
  7. var_dump(func_get_arg());
  8. function bar() {
  9. var_dump(func_get_arg(1));
  10. }
  11. function foo() {
  12. bar(func_get_arg(1));
  13. }
  14. foo(1,2);
  15. echo "Done\n";
  16. ?>
  17. --EXPECTF--
  18. Warning: func_get_arg() expects exactly 1 parameter, 3 given in %s on line %d
  19. NULL
  20. Warning: func_get_arg(): Called from the global scope - no function context in %s on line %d
  21. bool(false)
  22. Warning: func_get_arg() expects exactly 1 parameter, 0 given in %s on line %d
  23. NULL
  24. Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
  25. bool(false)
  26. Done