3v4l.org

run code in 300+ PHP versions simultaneously
<?php function func() { global $var; if ($var) { echo $var; } else { echo 'not defined'; } } class Clazz { public function method() { $var = 3; func(); } } $object = new Clazz(); $object->method();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/o3AL3
function name:  (null)
number of ops:  6
compiled vars:  !0 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'Clazz'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   25     3        INIT_METHOD_CALL                                         !0, 'method'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function func:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 4
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/o3AL3
function name:  func
number of ops:  6
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   BIND_GLOBAL                                              !0, 'var'
    6     1      > JMPZ                                                     !0, ->4
    7     2    >   ECHO                                                     !0
          3      > JMP                                                      ->5
    9     4    >   ECHO                                                     'not+defined'
   11     5    > > RETURN                                                   null

End of function func

Class Clazz:
Function method:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/o3AL3
function name:  method
number of ops:  4
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ASSIGN                                                   !0, 3
   19     1        INIT_FCALL                                               'func'
          2        DO_FCALL                                      0          
   20     3      > RETURN                                                   null

End of function method

End of class Clazz.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.21 ms | 1398 KiB | 14 Q