3v4l.org

run code in 300+ PHP versions simultaneously
<?php function argv() { $_GLOBALS["argv"] = func_get_args(); $_GLOBALS["argc"] = count($_SERVER["argv"]); } var_dump($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/1Et1X
function name:  (null)
number of ops:  19
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        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                                         $5      
         14        ASSIGN                                                   !1, $5
   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/1Et1X
function name:  argv
number of ops:  9
compiled vars:  !0 = $_GLOBALS
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   FUNC_GET_ARGS                                    ~2      
          1        ASSIGN_DIM                                               !0, 'argv'
          2        OP_DATA                                                  ~2
    6     3        FETCH_R                      global              ~4      '_SERVER'
          4        FETCH_DIM_R                                      ~5      ~4, 'argv'
          5        COUNT                                            ~6      ~5
          6        ASSIGN_DIM                                               !0, 'argc'
          7        OP_DATA                                                  ~6
    7     8      > RETURN                                                   null

End of function argv

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.01 ms | 1398 KiB | 18 Q