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 { } Test::hello(); Test::hello(); Test2::hello();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u2SDn
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_STATIC_METHOD_CALL                                  'Test', 'hello'
          1        DO_FCALL                                      0          
   22     2        INIT_STATIC_METHOD_CALL                                  'Test', 'hello'
          3        DO_FCALL                                      0          
   23     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 = 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/u2SDn
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/u2SDn
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:
171.12 ms | 1405 KiB | 15 Q