3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Aircraft { /** * @var string */ private $aircraftType; /** * @var string */ private $departureCity; /** * @var string */ private $arrivalCity; public function __construct( string $aircraftType, string $departureCity, string $arrivalCity ) { $this->aircraftType = $aircraftType; $this->departureCity = $departureCity; $this->arrivalCity = $arrivalCity; } public function __toString(): string { return sprintf( "Bienvenue à bord de notre %s.\n" . "Ce vol est en décollage imminent de %s et aura pour arrivée %s.", $this->aircraftType(), $this->departureCity(), $this->arrivalCity() ); } public function aircraftType(): string { return $this->aircraftType; } public function departureCity(): string { return $this->departureCity; } public function arrivalCity(): string { return $this->arrivalCity; } } class LowCostAircraft extends Aircraft { public function __construct( string $aircraftType, string $departureCity, string $arrivalCity ) { parent::__construct($aircraftType, $departureCity, $arrivalCity); } public function arrivalCity(): string { return sprintf("%s.\nLe moteur est le coeur d'un avion, mais le pilote est son âme", parent::arrivalCity()); } } echo new LowCostAircraft('easyJet', 'Nice', 'Mulhouse');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ECneC
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                                'aircraft'
   55     1        DECLARE_CLASS                                                'lowcostaircraft', 'aircraft'
   71     2        NEW                                                  $0      'LowCostAircraft'
          3        SEND_VAL_EX                                                  'easyJet'
          4        SEND_VAL_EX                                                  'Nice'
          5        SEND_VAL_EX                                                  'Mulhouse'
          6        DO_FCALL                                          0          
          7        ECHO                                                         $0
          8      > RETURN                                                       1

Class Aircraft:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ECneC
function name:  __construct
number of ops:  10
compiled vars:  !0 = $aircraftType, !1 = $departureCity, !2 = $arrivalCity
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   19     0  E >   RECV                                                 !0      
   20     1        RECV                                                 !1      
   21     2        RECV                                                 !2      
   23     3        ASSIGN_OBJ                                                   'aircraftType'
          4        OP_DATA                                                      !0
   24     5        ASSIGN_OBJ                                                   'departureCity'
          6        OP_DATA                                                      !1
   25     7        ASSIGN_OBJ                                                   'arrivalCity'
          8        OP_DATA                                                      !2
   26     9      > RETURN                                                       null

End of function __construct

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ECneC
function name:  __toString
number of ops:  17
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   33     0  E >   INIT_METHOD_CALL                                             'aircraftType'
          1        DO_FCALL                                          0  $0      
   34     2        INIT_METHOD_CALL                                             'departureCity'
          3        DO_FCALL                                          0  $1      
   35     4        INIT_METHOD_CALL                                             'arrivalCity'
          5        DO_FCALL                                          0  $2      
          6        ROPE_INIT                                         7  ~4      'Bienvenue+%C3%A0+bord+de+notre+'
          7        ROPE_ADD                                          1  ~4      ~4, $0
          8        ROPE_ADD                                          2  ~4      ~4, '.%0ACe+vol+est+en+d%C3%A9collage+imminent+de+'
          9        ROPE_ADD                                          3  ~4      ~4, $1
         10        ROPE_ADD                                          4  ~4      ~4, '+et+aura+pour+arriv%C3%A9e+'
         11        ROPE_ADD                                          5  ~4      ~4, $2
         12        ROPE_END                                          6  ~3      ~4, '.'
         13        VERIFY_RETURN_TYPE                                           ~3
         14      > RETURN                                                       ~3
   37    15*       VERIFY_RETURN_TYPE                                           
         16*     > RETURN                                                       null

End of function __tostring

Function aircrafttype:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ECneC
function name:  aircraftType
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   41     0  E >   FETCH_OBJ_R                                          ~0      'aircraftType'
          1        VERIFY_RETURN_TYPE                                           ~0
          2      > RETURN                                                       ~0
   42     3*       VERIFY_RETURN_TYPE                                           
          4*     > RETURN                                                       null

End of function aircrafttype

Function departurecity:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ECneC
function name:  departureCity
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   46     0  E >   FETCH_OBJ_R                                          ~0      'departureCity'
          1        VERIFY_RETURN_TYPE                                           ~0
          2      > RETURN                                                       ~0
   47     3*       VERIFY_RETURN_TYPE                                           
          4*     > RETURN                                                       null

End of function departurecity

Function arrivalcity:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ECneC
function name:  arrivalCity
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   51     0  E >   FETCH_OBJ_R                                          ~0      'arrivalCity'
          1        VERIFY_RETURN_TYPE                                           ~0
          2      > RETURN                                                       ~0
   52     3*       VERIFY_RETURN_TYPE                                           
          4*     > RETURN                                                       null

End of function arrivalcity

End of class Aircraft.

Class LowCostAircraft:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ECneC
function name:  __construct
number of ops:  9
compiled vars:  !0 = $aircraftType, !1 = $departureCity, !2 = $arrivalCity
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   58     0  E >   RECV                                                 !0      
   59     1        RECV                                                 !1      
   60     2        RECV                                                 !2      
   62     3        INIT_STATIC_METHOD_CALL                                      
          4        SEND_VAR_EX                                                  !0
          5        SEND_VAR_EX                                                  !1
          6        SEND_VAR_EX                                                  !2
          7        DO_FCALL                                          0          
   63     8      > RETURN                                                       null

End of function __construct

Function arrivalcity:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ECneC
function name:  arrivalCity
number of ops:  8
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   67     0  E >   INIT_STATIC_METHOD_CALL                                      'arrivalCity'
          1        DO_FCALL                                          0  $0      
          2        NOP                                                          
          3        FAST_CONCAT                                          ~1      $0, '.%0ALe+moteur+est+le+coeur+d%27un+avion%2C+mais+le+pilote+est+son+%C3%A2me'
          4        VERIFY_RETURN_TYPE                                           ~1
          5      > RETURN                                                       ~1
   68     6*       VERIFY_RETURN_TYPE                                           
          7*     > RETURN                                                       null

End of function arrivalcity

End of class LowCostAircraft.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.39 ms | 2149 KiB | 13 Q