3v4l.org

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

Class Test:
Function hello:
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/SFZDi
function name:  hello
number of ops:  9
compiled vars:  !0 = $my
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_STATIC                                              !0
    8     1      > JMPZ                                                     !0, ->4
    9     2    >   ASSIGN                                                   !0, '2'
          3      > JMP                                                      ->5
   11     4    >   ASSIGN                                                   !0, '1'
   13     5    >   INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
   14     8      > 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 = 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/SFZDi
function name:  hello
number of ops:  9
compiled vars:  !0 = $my
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_STATIC                                              !0
    8     1      > JMPZ                                                     !0, ->4
    9     2    >   ASSIGN                                                   !0, '2'
          3      > JMP                                                      ->5
   11     4    >   ASSIGN                                                   !0, '1'
   13     5    >   INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
   14     8      > RETURN                                                   null

End of function hello

End of class Test2.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.25 ms | 1388 KiB | 15 Q