3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public static function hello() { static $my; var_dump($my); if ($my) { $my = '2'; } else { $my = '1'; } var_dump($my); } } class Test2 extends Test { }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/W1V57
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E > > RETURN                                                   1

Class Test:
Function hello:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/W1V57
function name:  hello
number of ops:  12
compiled vars:  !0 = $my
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_STATIC                                              !0
    8     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    9     4      > JMPZ                                                     !0, ->7
   10     5    >   ASSIGN                                                   !0, '2'
          6      > JMP                                                      ->8
   12     7    >   ASSIGN                                                   !0, '1'
   14     8    >   INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
   15    11      > RETURN                                                   null

End of function hello

End of class Test.

Class Test2:
Function hello:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/W1V57
function name:  hello
number of ops:  12
compiled vars:  !0 = $my
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_STATIC                                              !0
    8     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    9     4      > JMPZ                                                     !0, ->7
   10     5    >   ASSIGN                                                   !0, '2'
          6      > JMP                                                      ->8
   12     7    >   ASSIGN                                                   !0, '1'
   14     8    >   INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
   15    11      > RETURN                                                   null

End of function hello

End of class Test2.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.61 ms | 1396 KiB | 15 Q