3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Base { public static function describe() { static $description = null; if ($description === null) { $description = "I am a " . static::getName() . "\n"; } return $description; } } class Car extends Base { protected static function getName() { return 'car'; } } class Peugot extends Car { protected static function getName() { return 'peugot'; } } class Renault extends Car { protected static function getName() { return 'renault'; } } echo Peugot::describe(); echo Renault::describe(); echo Car::describe();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Jmurv
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   INIT_STATIC_METHOD_CALL                                  'Peugot', 'describe'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
   28     3        INIT_STATIC_METHOD_CALL                                  'Renault', 'describe'
          4        DO_FCALL                                      0  $1      
          5        ECHO                                                     $1
   29     6        INIT_STATIC_METHOD_CALL                                  'Car', '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 = 8
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/Jmurv
function name:  describe
number of ops:  10
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, ->8
    8     3    >   INIT_STATIC_METHOD_CALL                                  'getName'
          4        DO_FCALL                                      0  $2      
          5        CONCAT                                           ~3      'I+am+a+', $2
          6        CONCAT                                           ~4      ~3, '%0A'
          7        ASSIGN                                                   !0, ~4
   11     8    > > RETURN                                                   !0
   12     9*     > RETURN                                                   null

End of function describe

End of class Base.

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

End of function getname

Function describe:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/Jmurv
function name:  describe
number of ops:  10
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, ->8
    8     3    >   INIT_STATIC_METHOD_CALL                                  'getName'
          4        DO_FCALL                                      0  $2      
          5        CONCAT                                           ~3      'I+am+a+', $2
          6        CONCAT                                           ~4      ~3, '%0A'
          7        ASSIGN                                                   !0, ~4
   11     8    > > RETURN                                                   !0
   12     9*     > RETURN                                                   null

End of function describe

End of class Car.

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

End of function getname

Function describe:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/Jmurv
function name:  describe
number of ops:  10
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, ->8
    8     3    >   INIT_STATIC_METHOD_CALL                                  'getName'
          4        DO_FCALL                                      0  $2      
          5        CONCAT                                           ~3      'I+am+a+', $2
          6        CONCAT                                           ~4      ~3, '%0A'
          7        ASSIGN                                                   !0, ~4
   11     8    > > RETURN                                                   !0
   12     9*     > RETURN                                                   null

End of function describe

End of class Peugot.

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

End of function getname

Function describe:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/Jmurv
function name:  describe
number of ops:  10
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, ->8
    8     3    >   INIT_STATIC_METHOD_CALL                                  'getName'
          4        DO_FCALL                                      0  $2      
          5        CONCAT                                           ~3      'I+am+a+', $2
          6        CONCAT                                           ~4      ~3, '%0A'
          7        ASSIGN                                                   !0, ~4
   11     8    > > RETURN                                                   !0
   12     9*     > RETURN                                                   null

End of function describe

End of class Renault.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.31 ms | 1394 KiB | 13 Q