3v4l.org

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

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