3v4l.org

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

Class Bird:
Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dVNjlV
function name:  getName
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'name'
          1      > RETURN                                                   ~0
    8     2*     > RETURN                                                   null

End of function getname

End of class Bird.

Class Eagle:
Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dVNjlV
function name:  getName
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'name'
          1      > RETURN                                                   ~0
    8     2*     > RETURN                                                   null

End of function getname

End of class Eagle.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.68 ms | 964 KiB | 14 Q