3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = 4; function myFunction () { if (!func_num_args()) { $input = $GLOBALS['foo']; } else { $input = func_get_arg(0); } echo "$input\n"; } myFunction('hello'); myFunction();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vvtWY
function name:  (null)
number of ops:  7
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 4
   15     1        INIT_FCALL                                               'myfunction'
          2        SEND_VAL                                                 'hello'
          3        DO_FCALL                                      0          
   16     4        INIT_FCALL                                               'myfunction'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function myfunction:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vvtWY
function name:  myFunction
number of ops:  14
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FUNC_NUM_ARGS                                    ~1      
          1        BOOL_NOT                                         ~2      ~1
          2      > JMPZ                                                     ~2, ->6
    7     3    >   FETCH_R                      global              ~3      'foo'
          4        ASSIGN                                                   !0, ~3
    6     5      > JMP                                                      ->10
   10     6    >   INIT_FCALL                                               'func_get_arg'
          7        SEND_VAL                                                 0
          8        DO_ICALL                                         $5      
          9        ASSIGN                                                   !0, $5
   12    10    >   NOP                                                      
         11        FAST_CONCAT                                      ~7      !0, '%0A'
         12        ECHO                                                     ~7
   13    13      > RETURN                                                   null

End of function myfunction

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.99 ms | 1004 KiB | 16 Q