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; } } echo new Aircraft('Airbus 319 Bravo', 'Toulouse', 'Paris');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FpTpB
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'aircraft'
   55     1        NEW                                              $0      'Aircraft'
          2        SEND_VAL_EX                                              'Airbus+319+Bravo'
          3        SEND_VAL_EX                                              'Toulouse'
          4        SEND_VAL_EX                                              'Paris'
          5        DO_FCALL                                      0          
          6        ECHO                                                     $0
          7      > RETURN                                                   1

Class Aircraft:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FpTpB
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/FpTpB
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/FpTpB
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/FpTpB
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/FpTpB
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.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.46 ms | 1400 KiB | 15 Q