3v4l.org

run code in 300+ PHP versions simultaneously
<?php function argv() { $_SERVER["argv"] = func_get_args(); $_SERVER["argc"] = count($_SERVER["argv"]); } var_dump($argv); $GLOBALS['argv'] = array(); $GLOBALS['argc'] = 0; argv("script.php", "-fvalue", "-h"); var_dump($argv); $options = getopt("f:hp:"); var_dump($options);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jF7Oe
function name:  (null)
number of ops:  25
compiled vars:  !0 = $argv, !1 = $options
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAR                                                 !0
          2        DO_ICALL                                                 
   11     3        FETCH_W                      global              $3      'GLOBALS'
          4        ASSIGN_DIM                                               $3, 'argv'
          5        OP_DATA                                                  <array>
   12     6        FETCH_W                      global              $5      'GLOBALS'
          7        ASSIGN_DIM                                               $5, 'argc'
          8        OP_DATA                                                  0
   14     9        INIT_FCALL                                               'argv'
         10        SEND_VAL                                                 'script.php'
         11        SEND_VAL                                                 '-fvalue'
         12        SEND_VAL                                                 '-h'
         13        DO_FCALL                                      0          
   18    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                                 
   20    17        INIT_FCALL                                               'getopt'
         18        SEND_VAL                                                 'f%3Ahp%3A'
         19        DO_ICALL                                         $9      
         20        ASSIGN                                                   !1, $9
   21    21        INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Function argv:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jF7Oe
function name:  argv
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   FUNC_GET_ARGS                                    ~2      
          1        FETCH_W                      global              $0      '_SERVER'
          2        ASSIGN_DIM                                               $0, 'argv'
          3        OP_DATA                                                  ~2
    4     4        FETCH_R                      global              ~5      '_SERVER'
          5        FETCH_DIM_R                                      ~6      ~5, 'argv'
          6        COUNT                                            ~7      ~6
          7        FETCH_W                      global              $3      '_SERVER'
          8        ASSIGN_DIM                                               $3, 'argc'
          9        OP_DATA                                                  ~7
    5    10      > RETURN                                                   null

End of function argv

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
293.98 ms | 1399 KiB | 19 Q