You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
407 B

  1. --TEST--
  2. Testing $argc and $argv handling (cli)
  3. --SKIPIF--
  4. <?php if(php_sapi_name()!='cli') echo 'skip'; ?>
  5. --INI--
  6. register_argc_argv=1
  7. variables_order=GPS
  8. --ARGS--
  9. ab cd ef 123 test
  10. --FILE--
  11. <?php
  12. if (!ini_get('register_globals')) {
  13. $argc = $_SERVER['argc'];
  14. $argv = $_SERVER['argv'];
  15. }
  16. for ($i=1; $i<$argc; $i++) {
  17. echo ($i-1).": ".$argv[$i]."\n";
  18. }
  19. ?>
  20. --EXPECT--
  21. 0: ab
  22. 1: cd
  23. 2: ef
  24. 3: 123
  25. 4: test