3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Base { public static function describe() { static $description = null; if ($description === null) { $description = "I am a " . get_called_class() . "\n"; } return $description; } } class Animal extends Base { } class Cat extends Animal { public static function describe() { return 'Miauw! ' . parent::describe(); } } class Dog extends Animal { } echo Cat::describe(); echo Dog::describe(); echo Animal::describe();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/61P72
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   29     0  E >   INIT_STATIC_METHOD_CALL                                      'Cat', 'describe'
          1        DO_FCALL                                          0  $0      
          2        ECHO                                                         $0
   30     3        INIT_STATIC_METHOD_CALL                                      'Dog', 'describe'
          4        DO_FCALL                                          0  $1      
          5        ECHO                                                         $1
   31     6        INIT_STATIC_METHOD_CALL                                      'Animal', 'describe'
          7        DO_FCALL                                          0  $2      
          8        ECHO                                                         $2
          9      > RETURN                                                       1

Class Base:
Function describe:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/61P72
function name:  describe
number of ops:  9
compiled vars:  !0 = $description
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   BIND_STATIC                                                  !0
    7     1        TYPE_CHECK                                        2          !0
          2      > JMPZ                                                         ~1, ->7
    8     3    >   GET_CALLED_CLASS                                     ~2      
          4        CONCAT                                               ~3      'I+am+a+', ~2
          5        CONCAT                                               ~4      ~3, '%0A'
          6        ASSIGN                                                       !0, ~4
   11     7    > > RETURN                                                       !0
   12     8*     > RETURN                                                       null

End of function describe

End of class Base.

Class Animal:
Function describe:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/61P72
function name:  describe
number of ops:  9
compiled vars:  !0 = $description
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   BIND_STATIC                                                  !0
    7     1        TYPE_CHECK                                        2          !0
          2      > JMPZ                                                         ~1, ->7
    8     3    >   GET_CALLED_CLASS                                     ~2      
          4        CONCAT                                               ~3      'I+am+a+', ~2
          5        CONCAT                                               ~4      ~3, '%0A'
          6        ASSIGN                                                       !0, ~4
   11     7    > > RETURN                                                       !0
   12     8*     > RETURN                                                       null

End of function describe

End of class Animal.

Class Cat:
Function describe:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/61P72
function name:  describe
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   21     0  E >   INIT_STATIC_METHOD_CALL                                      'describe'
          1        DO_FCALL                                          0  $0      
          2        CONCAT                                               ~1      'Miauw%21+', $0
          3      > RETURN                                                       ~1
   22     4*     > RETURN                                                       null

End of function describe

End of class Cat.

Class Dog:
Function describe:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/61P72
function name:  describe
number of ops:  9
compiled vars:  !0 = $description
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   BIND_STATIC                                                  !0
    7     1        TYPE_CHECK                                        2          !0
          2      > JMPZ                                                         ~1, ->7
    8     3    >   GET_CALLED_CLASS                                     ~2      
          4        CONCAT                                               ~3      'I+am+a+', ~2
          5        CONCAT                                               ~4      ~3, '%0A'
          6        ASSIGN                                                       !0, ~4
   11     7    > > RETURN                                                       !0
   12     8*     > RETURN                                                       null

End of function describe

End of class Dog.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.37 ms | 3082 KiB | 13 Q