3v4l.org

run code in 300+ PHP versions simultaneously
<?php function logMe($string) { global $foo; if (isset($foo)) { return $foo . $string; } } var_dump(logMe('string')); $foo = 'bar'; var_dump(logMe('string'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0OQ7g
function name:  (null)
number of ops:  14
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'logme'
          2        SEND_VAL                                                 'string'
          3        DO_FCALL                                      0  $1      
          4        SEND_VAR                                                 $1
          5        DO_ICALL                                                 
   13     6        ASSIGN                                                   !0, 'bar'
   15     7        INIT_FCALL                                               'var_dump'
          8        INIT_FCALL                                               'logme'
          9        SEND_VAL                                                 'string'
         10        DO_FCALL                                      0  $4      
         11        SEND_VAR                                                 $4
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function logme:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0OQ7g
function name:  logMe
number of ops:  7
compiled vars:  !0 = $string, !1 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        BIND_GLOBAL                                              !1, 'foo'
    6     2        ISSET_ISEMPTY_CV                                         !1
          3      > JMPZ                                                     ~2, ->6
    7     4    >   CONCAT                                           ~3      !1, !0
          5      > RETURN                                                   ~3
    9     6    > > RETURN                                                   null

End of function logme

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.54 ms | 1398 KiB | 17 Q