3v4l.org

run code in 300+ PHP versions simultaneously
<?php class stuff { public static function test2() { echo 'hi'; } public function test() { $this::test2(); } } class stuff2 extends stuff { public static function test2() { echo 'hello'; } } $a = new stuff(); $a->test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fSBXT
function name:  (null)
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $1      'stuff'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   25     3        INIT_METHOD_CALL                                         !0, 'test'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class stuff:
Function test2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fSBXT
function name:  test2
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ECHO                                                     'hi'
    7     1      > RETURN                                                   null

End of function test2

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fSBXT
function name:  test
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_THIS                                       ~0      
          1        FETCH_CLASS                                   0  $1      ~0
          2        INIT_STATIC_METHOD_CALL                                  $1, 'test2'
          3        DO_FCALL                                      0          
   12     4      > RETURN                                                   null

End of function test

End of class stuff.

Class stuff2:
Function test2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fSBXT
function name:  test2
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   ECHO                                                     'hello'
   21     1      > RETURN                                                   null

End of function test2

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fSBXT
function name:  test
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_THIS                                       ~0      
          1        FETCH_CLASS                                   0  $1      ~0
          2        INIT_STATIC_METHOD_CALL                                  $1, 'test2'
          3        DO_FCALL                                      0          
   12     4      > RETURN                                                   null

End of function test

End of class stuff2.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.18 ms | 1395 KiB | 13 Q