3v4l.org

run code in 300+ PHP versions simultaneously
<?php function argv() { $_SERVER["argv"] = func_get_args(); $_SERVER["argc"] = count($_SERVER["argv"]); } var_dump($_SERVER["argv"]); argv("script.php", "-fvalue", "-h"); $argv = $_SERVER["argv"]; 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/A5hR5
function name:  (null)
number of ops:  24
compiled vars:  !0 = $argv, !1 = $options
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_R                      global              ~2      '_SERVER'
          2        FETCH_DIM_R                                      ~3      ~2, 'argv'
          3        SEND_VAL                                                 ~3
          4        DO_ICALL                                                 
    9     5        INIT_FCALL                                               'argv'
          6        SEND_VAL                                                 'script.php'
          7        SEND_VAL                                                 '-fvalue'
          8        SEND_VAL                                                 '-h'
          9        DO_FCALL                                      0          
   11    10        FETCH_R                      global              ~6      '_SERVER'
         11        FETCH_DIM_R                                      ~7      ~6, 'argv'
         12        ASSIGN                                                   !0, ~7
   13    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                                 
   15    16        INIT_FCALL                                               'getopt'
         17        SEND_VAL                                                 'f%3Ahp%3A'
         18        DO_ICALL                                         $10     
         19        ASSIGN                                                   !1, $10
   16    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Function argv:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A5hR5
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:
155.92 ms | 1399 KiB | 18 Q