3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bird { public static $name = 'bird'; public function instance() { return new self(); } public function getName() { return self::$name; } public function name() { return __CLASS__; } } class Eagle extends Bird { public static $name = 'eagle'; public function name() { return __CLASS__; } } var_dump((new Bird)->instance()); //Bird class instance var_dump((new Eagle)->instance()); //Bird class instance 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/ZCVQ3
function name:  (null)
number of ops:  29
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   INIT_FCALL                                               'var_dump'
          1        NEW                                              $0      'Bird'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'instance'
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
   26     7        INIT_FCALL                                               'var_dump'
          8        NEW                                              $4      'Eagle'
          9        DO_FCALL                                      0          
         10        INIT_METHOD_CALL                                         $4, 'instance'
         11        DO_FCALL                                      0  $6      
         12        SEND_VAR                                                 $6
         13        DO_ICALL                                                 
   27    14        INIT_FCALL                                               'var_dump'
         15        NEW                                              $8      'Bird'
         16        DO_FCALL                                      0          
         17        INIT_METHOD_CALL                                         $8, 'getName'
         18        DO_FCALL                                      0  $10     
         19        SEND_VAR                                                 $10
         20        DO_ICALL                                                 
   28    21        INIT_FCALL                                               'var_dump'
         22        NEW                                              $12     'Eagle'
         23        DO_FCALL                                      0          
         24        INIT_METHOD_CALL                                         $12, 'getName'
         25        DO_FCALL                                      0  $14     
         26        SEND_VAR                                                 $14
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

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

End of function instance

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

End of function getname

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

End of function name

End of class Bird.

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

End of function name

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

End of function instance

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

End of function getname

End of class Eagle.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.76 ms | 969 KiB | 14 Q