3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function f() { return get_class(new static); } } class B extends A {} $b = new B; var_dump($b->f()); class C { public function f() { return get_called_class(); } } class D extends C {} $d = new D; var_dump($d->f());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/737XC
function name:  (null)
number of ops:  17
compiled vars:  !0 = $b, !1 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   NEW                                              $2      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
          3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'f'
          5        DO_FCALL                                      0  $5      
          6        SEND_VAR                                                 $5
          7        DO_ICALL                                                 
   12     8        NEW                                              $7      'D'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $7
         11        INIT_FCALL                                               'var_dump'
         12        INIT_METHOD_CALL                                         !1, 'f'
         13        DO_FCALL                                      0  $10     
         14        SEND_VAR                                                 $10
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

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

End of function f

End of class A.

Class B:
Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/737XC
function name:  f
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   NEW                          static              $0      
          1        DO_FCALL                                      0          
          2        GET_CLASS                                        ~2      $0
          3      > RETURN                                                   ~2
          4*     > RETURN                                                   null

End of function f

End of class B.

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

End of function f

End of class C.

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

End of function f

End of class D.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.3 ms | 1392 KiB | 15 Q