3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Adult { public static function get() { return new self(); } } class Child extends Adult {} var_dump(get_class_name(Adult::get())); var_dump(get_class_name(Child::get()));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uUfro
function name:  (null)
number of ops:  17
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL_BY_NAME                                       'get_class_name'
          2        INIT_STATIC_METHOD_CALL                                  'Adult', 'get'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR_NO_REF_EX                                       $0
          5        DO_FCALL                                      0  $1      
          6        SEND_VAR                                                 $1
          7        DO_ICALL                                                 
   13     8        INIT_FCALL                                               'var_dump'
          9        INIT_FCALL_BY_NAME                                       'get_class_name'
         10        INIT_STATIC_METHOD_CALL                                  'Child', 'get'
         11        DO_FCALL                                      0  $3      
         12        SEND_VAR_NO_REF_EX                                       $3
         13        DO_FCALL                                      0  $4      
         14        SEND_VAR                                                 $4
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

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

End of function get

End of class Adult.

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

End of function get

End of class Child.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.58 ms | 1388 KiB | 15 Q