3v4l.org

run code in 300+ 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 PrivateJet extends Aircraft { private $arrivalCity; /** * @var string */ private $airportDestination; public function __construct( string $aircraftType, string $departureCity, string $arrivalCity, string $airportDestination ) { parent::__construct($aircraftType, $departureCity, $arrivalCity); $this->airportDestination = $airportDestination; } public function __toString(): string { return sprintf( "%s\n" . "Notre arrivé se fera à l'aéroport %s.", parent::__toString(), $this->airportDestination() ); } public function airportDestination(): string { return $this->airportDestination; } } echo new PrivateJet('Wijet', 'Lyon', 'Bordeaux', 'de Bordeaux-Mérignac');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eA0Zt
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'aircraft'
   55     1        DECLARE_CLASS                                            'privatejet', 'aircraft'
   90     2        NEW                                              $0      'PrivateJet'
          3        SEND_VAL_EX                                              'Wijet'
          4        SEND_VAL_EX                                              'Lyon'
          5        SEND_VAL_EX                                              'Bordeaux'
          6        SEND_VAL_EX                                              'de+Bordeaux-M%C3%A9rignac'
          7        DO_FCALL                                      0          
          8        ECHO                                                     $0
          9      > RETURN                                                   1

Class Aircraft:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eA0Zt
function name:  __construct
number of ops:  10
compiled vars:  !0 = $aircraftType, !1 = $departureCity, !2 = $arrivalCity
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          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/eA0Zt
function name:  __toString
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   INIT_FCALL                                               'sprintf'
   32     1        SEND_VAL                                                 'Bienvenue+%C3%A0+bord+de+notre+%25s.%0ACe+vol+est+en+d%C3%A9collage+imminent+de+%25s+et+aura+pour+arriv%C3%A9e+%25s.'
   33     2        INIT_METHOD_CALL                                         'aircraftType'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
   34     5        INIT_METHOD_CALL                                         'departureCity'
          6        DO_FCALL                                      0  $1      
          7        SEND_VAR                                                 $1
   35     8        INIT_METHOD_CALL                                         'arrivalCity'
          9        DO_FCALL                                      0  $2      
         10        SEND_VAR                                                 $2
         11        DO_ICALL                                         $3      
         12        VERIFY_RETURN_TYPE                                       $3
         13      > RETURN                                                   $3
   37    14*       VERIFY_RETURN_TYPE                                       
         15*     > 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/eA0Zt
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/eA0Zt
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/eA0Zt
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 PrivateJet:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eA0Zt
function name:  __construct
number of ops:  12
compiled vars:  !0 = $aircraftType, !1 = $departureCity, !2 = $arrivalCity, !3 = $airportDestination
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   63     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
   69     4        INIT_STATIC_METHOD_CALL                                  
          5        SEND_VAR_EX                                              !0
          6        SEND_VAR_EX                                              !1
          7        SEND_VAR_EX                                              !2
          8        DO_FCALL                                      0          
   71     9        ASSIGN_OBJ                                               'airportDestination'
         10        OP_DATA                                                  !3
   72    11      > 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/eA0Zt
function name:  __toString
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   76     0  E >   INIT_FCALL                                               'sprintf'
   78     1        SEND_VAL                                                 '%25s%0ANotre+arriv%C3%A9+se+fera+%C3%A0+l%27a%C3%A9roport+%25s.'
   79     2        INIT_STATIC_METHOD_CALL                                  '__toString'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
   80     5        INIT_METHOD_CALL                                         'airportDestination'
          6        DO_FCALL                                      0  $1      
          7        SEND_VAR                                                 $1
          8        DO_ICALL                                         $2      
          9        VERIFY_RETURN_TYPE                                       $2
         10      > RETURN                                                   $2
   82    11*       VERIFY_RETURN_TYPE                                       
         12*     > RETURN                                                   null

End of function __tostring

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

End of function airportdestination

End of class PrivateJet.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.72 ms | 949 KiB | 16 Q