3v4l.org

run code in 300+ PHP versions simultaneously
l<?php class A { public function dd() { echo get_called_class(); } public static function foo() { return static::bar(); } } class B extends A { protected static function bar() { echo 'bar'; } } B::foo(); echo "\n"; echo __CLASS__."\n"; $a = new B; $a->dd();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/roesa
function name:  (null)
number of ops:  11
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     'l'
   17     1        INIT_STATIC_METHOD_CALL                                  'B', 'foo'
          2        DO_FCALL                                      0          
   19     3        ECHO                                                     '%0A'
   20     4        ECHO                                                     '%0A'
   22     5        NEW                                              $2      'B'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !0, $2
   23     8        INIT_METHOD_CALL                                         !0, 'dd'
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

Class A:
Function dd:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/roesa
function name:  dd
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   GET_CALLED_CLASS                                 ~0      
          1        ECHO                                                     ~0
    5     2      > RETURN                                                   null

End of function dd

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

End of function foo

End of class A.

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

End of function bar

Function dd:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/roesa
function name:  dd
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   GET_CALLED_CLASS                                 ~0      
          1        ECHO                                                     ~0
    5     2      > RETURN                                                   null

End of function dd

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

End of function foo

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.99 ms | 1399 KiB | 13 Q