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'; } public static function describe() { return 'Vroom! ' . parent::describe(); } } class Renault extends Car { protected static function getName() { return 'renault'; } } $car = new Car; $peugot = new Peugot; $renault = new Renault; echo $car::describe(); echo $peugot::describe(); echo $renault::describe();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UHdZ9
function name:  (null)
number of ops:  22
compiled vars:  !0 = $car, !1 = $peugot, !2 = $renault
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   NEW                                              $3      'Car'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   33     3        NEW                                              $6      'Peugot'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $6
   34     6        NEW                                              $9      'Renault'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !2, $9
   36     9        FETCH_CLASS                                   0  $12     !0
         10        INIT_STATIC_METHOD_CALL                                  $12, 'describe'
         11        DO_FCALL                                      0  $13     
         12        ECHO                                                     $13
   37    13        FETCH_CLASS                                   0  $14     !1
         14        INIT_STATIC_METHOD_CALL                                  $14, 'describe'
         15        DO_FCALL                                      0  $15     
         16        ECHO                                                     $15
   38    17        FETCH_CLASS                                   0  $16     !2
         18        INIT_STATIC_METHOD_CALL                                  $16, 'describe'
         19        DO_FCALL                                      0  $17     
         20        ECHO                                                     $17
         21      > 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/UHdZ9
function name:  describe
number of ops:  10
compiled vars:  !0 = $description
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   BIND_STATIC                                              !0
    8     1        TYPE_CHECK                                    2          !0
          2      > JMPZ                                                     ~1, ->8
    9     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
   12     8    > > RETURN                                                   !0
   13     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/UHdZ9
function name:  getName
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     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/UHdZ9
function name:  describe
number of ops:  10
compiled vars:  !0 = $description
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   BIND_STATIC                                              !0
    8     1        TYPE_CHECK                                    2          !0
          2      > JMPZ                                                     ~1, ->8
    9     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
   12     8    > > RETURN                                                   !0
   13     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/UHdZ9
function name:  getName
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E > > RETURN                                                   'peugot'
          1*     > RETURN                                                   null

End of function getname

Function describe:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UHdZ9
function name:  describe
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_STATIC_METHOD_CALL                                  'describe'
          1        DO_FCALL                                      0  $0      
          2        CONCAT                                           ~1      'Vroom%21+', $0
          3      > RETURN                                                   ~1
   25     4*     > 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/UHdZ9
function name:  getName
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     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/UHdZ9
function name:  describe
number of ops:  10
compiled vars:  !0 = $description
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   BIND_STATIC                                              !0
    8     1        TYPE_CHECK                                    2          !0
          2      > JMPZ                                                     ~1, ->8
    9     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
   12     8    > > RETURN                                                   !0
   13     9*     > RETURN                                                   null

End of function describe

End of class Renault.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.97 ms | 1394 KiB | 13 Q