3v4l.org

run code in 500+ PHP versions simultaneously
<?php $argv = [1,2,3]; $_POST = [1,2,3]; function foo(?array $argv = null) { if ($argv === null) { global $argv; } print_r($argv); } foo(); foo([4,5,6]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UBSoD
function name:  (null)
number of ops:  9
compiled vars:  !0 = $argv
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        FETCH_W                          global              $2      '_POST'
          2        ASSIGN                                                       $2, <array>
   14     3        INIT_FCALL                                                   'foo'
          4        DO_FCALL                                          0          
   15     5        INIT_FCALL                                                   'foo'
          6        SEND_VAL                                                     <array>
          7        DO_FCALL                                          0          
          8      > RETURN                                                       1

Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
filename:       /in/UBSoD
function name:  foo
number of ops:  8
compiled vars:  !0 = $argv
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV_INIT                                            !0      null
    7     1        TYPE_CHECK                                        2          !0
          2      > JMPZ                                                         ~1, ->4
    8     3    >   BIND_GLOBAL                                                  !0, 'argv'
   11     4    >   INIT_FCALL                                                   'print_r'
          5        SEND_VAR                                                     !0
          6        DO_ICALL                                                     
   12     7      > RETURN                                                       null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
169.08 ms | 1183 KiB | 16 Q