3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { public static function get() { $me = get_called_class(); return new $me; } } class b extends a {} print_r(b::get());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XL7Yq
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'print_r'
          1        INIT_STATIC_METHOD_CALL                                  'b', 'get'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR                                                 $0
          4        DO_ICALL                                                 
          5      > RETURN                                                   1

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

End of function get

End of class a.

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

End of function get

End of class b.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.3 ms | 1395 KiB | 15 Q