3v4l.org

run code in 300+ PHP versions simultaneously
<?php class derp { public static function foo() { $me = get_called_class(); return $me::bar(); } public static function bar() { return 'foobar'; } } class herp extends derp { public static function bar() { return 'hurrdurr'; } } echo herp::foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bG8ov
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_STATIC_METHOD_CALL                                  'herp', 'foo'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
          3      > RETURN                                                   1

Class derp:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bG8ov
function name:  foo
number of ops:  7
compiled vars:  !0 = $me
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   GET_CALLED_CLASS                                 ~1      
          1        ASSIGN                                                   !0, ~1
    6     2        FETCH_CLASS                                   0  $3      !0
          3        INIT_STATIC_METHOD_CALL                                  $3, 'bar'
          4        DO_FCALL                                      0  $4      
          5      > RETURN                                                   $4
    7     6*     > RETURN                                                   null

End of function foo

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bG8ov
function name:  bar
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E > > RETURN                                                   'foobar'
   10     1*     > RETURN                                                   null

End of function bar

End of class derp.

Class herp:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bG8ov
function name:  bar
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E > > RETURN                                                   'hurrdurr'
   15     1*     > RETURN                                                   null

End of function bar

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bG8ov
function name:  foo
number of ops:  7
compiled vars:  !0 = $me
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   GET_CALLED_CLASS                                 ~1      
          1        ASSIGN                                                   !0, ~1
    6     2        FETCH_CLASS                                   0  $3      !0
          3        INIT_STATIC_METHOD_CALL                                  $3, 'bar'
          4        DO_FCALL                                      0  $4      
          5      > RETURN                                                   $4
    7     6*     > RETURN                                                   null

End of function foo

End of class herp.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.63 ms | 1395 KiB | 13 Q