3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); class Room { private $number; private $countOfGuests; private $price; private $arrivalDate; private $dateOfDeparture; private $guests = array("firstName" => array(), "lastName" => array()); private $isFree = TRUE; public function __construct(int $number, int $countOfGuests, int $price, DateTime $arrivalDate, DateTime $dateOfDeparture) { $this->number = $number; $this->price = $price; $this->countOfGuests = $countOfGuests; $this->arrivalDate = $arrivalDate; $this->dateOfDeparture = $dateOfDeparture; } public function getIsFree(): bool { return $this->isFree; } public function changeIsFtee():void { if ($this->isFree == TRUE){ $this->isFree = FALSE; } else { $this->isFree = TRUE; } } public function getArrivalDate(): DateTime { return $this->arrivalDate; } public function getDateOfDeparture(): DateTime { return $this->dateOfDeparture; } public function addGuestToRoom($firstName, $lastName): void { $this->guests["firstName"][] = $firstName; $this->guests["lastName"][] = $lastName; } public function getPrice(): int { return $this->price; } public function getCountOfGuests(): int { return $this->countOfGuests; } public function getGuests(): array { return $this->guests; } public function getNumber(): int { return $this->number; } public function setDate(Hotel $hotel, DateTime $arrivalDate, DateTime $dateOfDeparture): void { $this->arrivalDate = $arrivalDate; $this->dateOfDeparture = $dateOfDeparture; } } class Hotel { private $rooms = array(); private $guests = array(); private $receipts = array("date" => array(), "money" => array()); public function addRoomForHotel(int $countOfGuests, int $price): void { $this->rooms[] = new Room(count($this->rooms) + 1, $countOfGuests, $price, new DateTime(), new DateTime()); } public function addGuest(string $firstName, string $lastName): void { $this->guests[] = new Guest($firstName, $lastName); } public function getRooms(): array { return $this->rooms; } public function getRoom(int $numberOfRoom): Room { return $this->rooms[$numberOfRoom - 1]; } public function getGuest(string $firstName, string $lastName): Guest { foreach ($this->guests as $guest) { if ($guest->getFirstName() == $firstName && $guest->getLastName() == $lastName){ return $guest; break; } } if (1){ throw new Exception("Неправильно введены данные клиента"); } } public function getReceipts(): array { return $this->receipts; } public function addDateOfReceipts(DateTime $date): void { $this->receipts["date"][] = $date; } public function addMoneyOfReceipts(int $money): void { $this->receipts["money"][] = $money; } public function replenishMoney(int $money, int $numberInArray): void { $this->receipts["money"][$numberInArray] += $money; } } class Guest { private $firstName; private $lastName; private $visitedRooms = array(); public function __construct(string $firstName, string $lastName) { $this->firstName = $firstName; $this->lastName = $lastName; } public function addVisitedRoom(int $numberOfRoom): void { $this->visitedRooms[] = $numberOfRoom; } public function getFirstName(): string { return $this->firstName; } public function getLastName(): string { return $this->lastName; } public function getVisitedRooms(): array { return $this->visitedRooms; } } class Registration { public function getStatisticOfReceipts(Hotel $hotel, DateTime $startDate, DateTime $endDate): void { echo "Дата Сумма\n"; foreach ($hotel->getReceipts()["date"] as $key => $date) { if($date == $startDate || $date > $startDate){ for($i = $key; $hotel->getReceipts()["date"][$i] != $endDate; $i++){ echo $hotel->getReceipts()["date"][$i]->format('Y-m-d'), " ", $hotel->getReceipts()["money"][$i], "\n"; if($hotel->getReceipts()["date"][$i] == end($hotel->getReceipts()["date"])){ break; } } } break; } } public function registerGuests(Hotel $hotel, int $numberOfRoom, string $firstName, string $lastName, DateTime $arrivalDate, DateTime $dateOfDeparture): void { $hotel->getRoom($numberOfRoom)->setDate($hotel, $arrivalDate, $dateOfDeparture); $hotel->getRoom($numberOfRoom)->addGuestToRoom($firstName, $lastName); $hotel->getRoom($numberOfRoom)->changeIsFtee(); $hotel->getGuest($firstName, $lastName)->addVisitedRoom($numberOfRoom); $this->addReceiptsForHotel($hotel, $numberOfRoom, $arrivalDate); } public function selectRoom(Hotel $hotel, DateTime $arrivalDate, DateTime $dateOfDeparture, int $countOfGuests): void { $availableRoom = $this->searchRooms($hotel, $dateOfDeparture, $arrivalDate); $roomsForList = array(); while ($countOfGuests > 0) { $maxCountOfGuestInRoom = $availableRoom[0]->getCountOfGuests(); foreach ($availableRoom as $room) { if ($room->getCountOfGuests() > $maxCountOfGuestInRoom && $room->getCountOfGuests() <= $countOfGuests){ $maxCountOfGuestInRoom = $room->getCountOfGuests(); } } $roomsForList[] = $this->SearchSuitableRoom($hotel, $arrivalDate, $dateOfDeparture, $maxCountOfGuestInRoom); end($roomsForList)->changeIsFtee(); $countOfGuests -= $maxCountOfGuestInRoom; } $this->printInformationOfRooms($roomsForList); foreach ($roomsForList as $room) { $room->changeIsFtee(); } } public function getFreeRoomsInRange(Hotel $hotel, DateTime $arrivalDate, DateTime $dateOfDeparture):void { $this->printInformationOfRooms($this->searchRooms($hotel, $dateOfDeparture, $arrivalDate)); } public function getFreeRooms(Hotel $hotel, DateTime $date): void { $this->printInformationOfRooms($this->searchRooms($hotel, $date, $date)); } private function searchRooms(Hotel $hotel, DateTime $date1, DateTime $date2) { $freeRooms = array(); foreach ($hotel->getRooms() as $room) { if ($room->getIsFree() && ($room->getArrivalDate() > $date1 || $room->getDateOfDeparture() < $date2)){ $freeRooms[] = $room; } } return $freeRooms; } private function SearchSuitableRoom(Hotel $hotel, DateTime $arrivalDate, DateTime $dateOfDeparture, int $countOfGuests): Room { $availableRoom = $this->searchRooms($hotel, $dateOfDeparture, $arrivalDate); foreach ($availableRoom as $number => $room) { if ($room->getCountOfGuests() < $countOfGuests){ unset($availableRoom[$number]); } } sort($availableRoom); if (count($availableRoom) == 0){ throw new Exception("Нет подходящих номеров"); } $minPrice = $availableRoom[0]->getPrice(); foreach ($availableRoom as $number => $room) { if ($room->getPrice() < $minPrice){ $minPrice = $room->getPrice(); for ($i = 0; $i < $number; $i++){ unset($availableRoom[$i]); } } elseif ($room->getPrice() > $minPrice){ unset($availableRoom[$number]); } } sort($availableRoom); $minGuests = $availableRoom[0]->getCountOfGuests(); foreach ($availableRoom as $number => $room) { if ($room->getCountOfGuests() < $minGuests){ $minGuests = $room->getCountOfGuests(); for ($i = 0; $i < $number; $i++){ unset($availableRoom[$i]); } } elseif ($room->getCountOfGuests() > $minGuests){ unset($availableRoom[$number]); } } sort($availableRoom); return $availableRoom[0]; } public function printHistoryOfGuest(Hotel $hotel, string $firstName, string $lastName): void { echo "\n$firstName $lastName История\n"; $rooms = $hotel->getGuest($firstName, $lastName)->getVisitedRooms(); foreach ($rooms as &$room) { $room = $hotel->getRoom($room); } $this->printInformationOfRooms($rooms); } public function printHistoryOfRoom(Hotel $hotel, int $numberOfRoom): void { echo "\nИстория комнаты № $numberOfRoom\n\n"; echo "Имя Фамилия\n"; $guests = $hotel->getRoom($numberOfRoom)->getGuests(); for($i = 0; $i < count($guests["firstName"]); $i++){ echo $this->padLeft($guests["firstName"][$i], 10) . $this->padLeft($guests["lastName"][$i], 10) . "\n"; } } private function printInformationOfRooms(array $rooms): void { echo "\nНомер вместимость стоимость\n"; foreach($rooms as $room){ $this->printRoomsRow($room->getNumber(), $room->getCountOfGuests(), $room->getPrice()); } } private function padLeft($value, int $columnLength): void { echo $value; echo str_repeat(" ", $columnLength - mb_strlen($value)); } private function printRoomsRow(int $numberOfRoom, int $countOfGuests, int $price): void { $col1 = 6; $col2 = 12; $col3 = 20; echo $this->padLeft($numberOfRoom, $col1) . $this->padLeft($countOfGuests, $col2) . $this->padLeft($price, $col3) . "\n"; } private function addReceiptsForHotel(Hotel $hotel, int $numberOfRoom, DateTime $arrivalDate): void { foreach ($hotel->getReceipts()["date"] as $key => $date) { if ($arrivalDate == $date){ $hotel->replenishMoney($hotel->getRoom($numberOfRoom)->getPrice(), $key); return; } } $hotel->addDateOfReceipts($arrivalDate); $hotel->addMoneyOfReceipts($hotel->getRoom($numberOfRoom)->getPrice()); } } $hotel = new Hotel; $hotel->addRoomForHotel(1, 500); $hotel->addRoomForHotel(3, 700); $hotel->addRoomForHotel(2, 1500); $hotel->addRoomForHotel(2, 1500); $hotel->addRoomForHotel(3, 1500); $hotel->addGuest("Ivan", "Ivanov"); $hotel->addGuest("Petr", "Petrov"); $registration = new Registration; $registration->registerGuests($hotel, 3, "Ivan", "Ivanov", new DateTime('2015-05-10'), new DateTime('2015-05-22')); $registration->registerGuests($hotel, 1, "Petr", "Petrov", new DateTime('2015-05-10'), new DateTime('2015-05-12')); $registration->registerGuests($hotel, 4, "Ivan", "Ivanov", new DateTime('2015-05-27'), new DateTime('2015-06-03')); $registration->registerGuests($hotel, 3, "Petr", "Petrov", new DateTime('2015-07-13'), new DateTime('2015-07-15')); // $registration->getFreeRooms($hotel, new DateTime('2015-05-12')); // $registration->getFreeRoomsInRange($hotel, new DateTime('2015-05-13'), new DateTime('2015-05-25')); // $registration->selectRoom($hotel, new DateTime('2015-05-12'), new DateTime('2015-05-25'), 4); // $registration->printHistoryOfGuest($hotel, "Ivan", "Ivanov"); // $registration->printHistoryOfRoom($hotel, 3); // $registration->getStatisticOfReceipts($hotel, new DateTime('2015-05-05'), new DateTime('2015-07-25'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ULIPK
function name:  (null)
number of ops:  94
compiled vars:  !0 = $hotel, !1 = $registration
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 -1
          2        DO_ICALL                                                 
  363     3        NEW                                              $3      'Hotel'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $3
  365     6        INIT_METHOD_CALL                                         !0, 'addRoomForHotel'
          7        SEND_VAL_EX                                              1
          8        SEND_VAL_EX                                              500
          9        DO_FCALL                                      0          
  366    10        INIT_METHOD_CALL                                         !0, 'addRoomForHotel'
         11        SEND_VAL_EX                                              3
         12        SEND_VAL_EX                                              700
         13        DO_FCALL                                      0          
  367    14        INIT_METHOD_CALL                                         !0, 'addRoomForHotel'
         15        SEND_VAL_EX                                              2
         16        SEND_VAL_EX                                              1500
         17        DO_FCALL                                      0          
  368    18        INIT_METHOD_CALL                                         !0, 'addRoomForHotel'
         19        SEND_VAL_EX                                              2
         20        SEND_VAL_EX                                              1500
         21        DO_FCALL                                      0          
  369    22        INIT_METHOD_CALL                                         !0, 'addRoomForHotel'
         23        SEND_VAL_EX                                              3
         24        SEND_VAL_EX                                              1500
         25        DO_FCALL                                      0          
  371    26        INIT_METHOD_CALL                                         !0, 'addGuest'
         27        SEND_VAL_EX                                              'Ivan'
         28        SEND_VAL_EX                                              'Ivanov'
         29        DO_FCALL                                      0          
  372    30        INIT_METHOD_CALL                                         !0, 'addGuest'
         31        SEND_VAL_EX                                              'Petr'
         32        SEND_VAL_EX                                              'Petrov'
         33        DO_FCALL                                      0          
  374    34        NEW                                              $13     'Registration'
         35        DO_FCALL                                      0          
         36        ASSIGN                                                   !1, $13
  376    37        INIT_METHOD_CALL                                         !1, 'registerGuests'
         38        SEND_VAR_EX                                              !0
         39        SEND_VAL_EX                                              3
         40        SEND_VAL_EX                                              'Ivan'
         41        SEND_VAL_EX                                              'Ivanov'
         42        NEW                                              $16     'DateTime'
         43        SEND_VAL_EX                                              '2015-05-10'
         44        DO_FCALL                                      0          
         45        SEND_VAR_NO_REF_EX                                       $16
         46        NEW                                              $18     'DateTime'
         47        SEND_VAL_EX                                              '2015-05-22'
         48        DO_FCALL                                      0          
         49        SEND_VAR_NO_REF_EX                                       $18
         50        DO_FCALL                                      0          
  377    51        INIT_METHOD_CALL                                         !1, 'registerGuests'
         52        SEND_VAR_EX                                              !0
         53        SEND_VAL_EX                                              1
         54        SEND_VAL_EX                                              'Petr'
         55        SEND_VAL_EX                                              'Petrov'
         56        NEW                                              $21     'DateTime'
         57        SEND_VAL_EX                                              '2015-05-10'
         58        DO_FCALL                                      0          
         59        SEND_VAR_NO_REF_EX                                       $21
         60        NEW                                              $23     'DateTime'
         61        SEND_VAL_EX                                              '2015-05-12'
         62        DO_FCALL                                      0          
         63        SEND_VAR_NO_REF_EX                                       $23
         64        DO_FCALL                                      0          
  378    65        INIT_METHOD_CALL                                         !1, 'registerGuests'
         66        SEND_VAR_EX                                              !0
         67        SEND_VAL_EX                                              4
         68        SEND_VAL_EX                                              'Ivan'
         69        SEND_VAL_EX                                              'Ivanov'
         70        NEW                                              $26     'DateTime'
         71        SEND_VAL_EX                                              '2015-05-27'
         72        DO_FCALL                                      0          
         73        SEND_VAR_NO_REF_EX                                       $26
         74        NEW                                              $28     'DateTime'
         75        SEND_VAL_EX                                              '2015-06-03'
         76        DO_FCALL                                      0          
         77        SEND_VAR_NO_REF_EX                                       $28
         78        DO_FCALL                                      0          
  379    79        INIT_METHOD_CALL                                         !1, 'registerGuests'
         80        SEND_VAR_EX                                              !0
         81        SEND_VAL_EX                                              3
         82        SEND_VAL_EX                                              'Petr'
         83        SEND_VAL_EX                                              'Petrov'
         84        NEW                                              $31     'DateTime'
         85        SEND_VAL_EX                                              '2015-07-13'
         86        DO_FCALL                                      0          
         87        SEND_VAR_NO_REF_EX                                       $31
         88        NEW                                              $33     'DateTime'
         89        SEND_VAL_EX                                              '2015-07-15'
         90        DO_FCALL                                      0          
         91        SEND_VAR_NO_REF_EX                                       $33
         92        DO_FCALL                                      0          
  386    93      > RETURN                                                   1

Class Room:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ULIPK
function name:  __construct
number of ops:  16
compiled vars:  !0 = $number, !1 = $countOfGuests, !2 = $price, !3 = $arrivalDate, !4 = $dateOfDeparture
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
          4        RECV                                             !4      
   17     5        ASSIGN_OBJ                                               'number'
          6        OP_DATA                                                  !0
   18     7        ASSIGN_OBJ                                               'price'
          8        OP_DATA                                                  !2
   19     9        ASSIGN_OBJ                                               'countOfGuests'
         10        OP_DATA                                                  !1
   20    11        ASSIGN_OBJ                                               'arrivalDate'
         12        OP_DATA                                                  !3
   21    13        ASSIGN_OBJ                                               'dateOfDeparture'
         14        OP_DATA                                                  !4
   22    15      > RETURN                                                   null

End of function __construct

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

End of function getisfree

Function changeisftee:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ULIPK
function name:  changeIsFtee
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   FETCH_OBJ_R                                      ~0      'isFree'
          1        BOOL                                             ~1      ~0
          2      > JMPZ                                                     ~1, ->6
   32     3    >   ASSIGN_OBJ                                               'isFree'
          4        OP_DATA                                                  <false>
   31     5      > JMP                                                      ->8
   34     6    >   ASSIGN_OBJ                                               'isFree'
          7        OP_DATA                                                  <true>
   36     8    > > RETURN                                                   null

End of function changeisftee

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

End of function getarrivaldate

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

End of function getdateofdeparture

Function addguesttoroom:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ULIPK
function name:  addGuestToRoom
number of ops:  11
compiled vars:  !0 = $firstName, !1 = $lastName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   48     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   50     2        FETCH_OBJ_W                                      $2      'guests'
          3        FETCH_DIM_W                                      $3      $2, 'firstName'
          4        ASSIGN_DIM                                               $3
          5        OP_DATA                                                  !0
   51     6        FETCH_OBJ_W                                      $5      'guests'
          7        FETCH_DIM_W                                      $6      $5, 'lastName'
          8        ASSIGN_DIM                                               $6
          9        OP_DATA                                                  !1
   52    10      > RETURN                                                   null

End of function addguesttoroom

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

End of function getprice

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

End of function getcountofguests

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

End of function getguests

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

End of function getnumber

Function setdate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ULIPK
function name:  setDate
number of ops:  8
compiled vars:  !0 = $hotel, !1 = $arrivalDate, !2 = $dateOfDeparture
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   74     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   76     3        ASSIGN_OBJ                                               'arrivalDate'
          4        OP_DATA                                                  !1
   77     5        ASSIGN_OBJ                                               'dateOfDeparture'
          6        OP_DATA                                                  !2
   78     7      > RETURN                                                   null

End of function setdate

End of class Room.

Class Hotel:
Function addroomforhotel:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ULIPK
function name:  addRoomForHotel
number of ops:  20
compiled vars:  !0 = $countOfGuests, !1 = $price
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   87     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   89     2        NEW                                              $4      'Room'
          3        FETCH_OBJ_R                                      ~5      'rooms'
          4        COUNT                                            ~6      ~5
          5        ADD                                              ~7      ~6, 1
          6        SEND_VAL_EX                                              ~7
          7        SEND_VAR_EX                                              !0
          8        SEND_VAR_EX                                              !1
          9        NEW                                              $8      'DateTime'
         10        DO_FCALL                                      0          
         11        SEND_VAR_NO_REF_EX                                       $8
         12        NEW                                              $10     'DateTime'
         13        DO_FCALL                                      0          
         14        SEND_VAR_NO_REF_EX                                       $10
         15        DO_FCALL                                      0          
         16        FETCH_OBJ_W                                      $2      'rooms'
         17        ASSIGN_DIM                                               $2
         18        OP_DATA                                                  $4
   90    19      > RETURN                                                   null

End of function addroomforhotel

Function addguest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ULIPK
function name:  addGuest
number of ops:  10
compiled vars:  !0 = $firstName, !1 = $lastName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   92     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   94     2        NEW                                              $4      'Guest'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0          
          6        FETCH_OBJ_W                                      $2      'guests'
          7        ASSIGN_DIM                                               $2
          8        OP_DATA                                                  $4
   95     9      > RETURN                                                   null

End of function addguest

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

End of function getrooms

Function getroom:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ULIPK
function name:  getRoom
number of ops:  8
compiled vars:  !0 = $numberOfRoom
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  102     0  E >   RECV                                             !0      
  104     1        SUB                                              ~2      !0, 1
          2        FETCH_OBJ_R                                      ~1      'rooms'
          3        FETCH_DIM_R                                      ~3      ~1, ~2
          4        VERIFY_RETURN_TYPE                                       ~3
          5      > RETURN                                                   ~3
  105     6*       VERIFY_RETURN_TYPE                                       
          7*     > RETURN                                                   null

End of function getroom

Function getguest:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 19
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 19
Branch analysis from position: 5
2 jumps found. (Code = 46) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 18
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 13
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 25
Branch analysis from position: 21
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/ULIPK
function name:  getGuest
number of ops:  27
compiled vars:  !0 = $firstName, !1 = $lastName, !2 = $guest
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  107     0  E >   RECV                                             !0      
          1        RECV                                             !1      
  109     2        FETCH_OBJ_R                                      ~3      'guests'
          3      > FE_RESET_R                                       $4      ~3, ->19
          4    > > FE_FETCH_R                                               $4, !2, ->19
  110     5    >   INIT_METHOD_CALL                                         !2, 'getFirstName'
          6        DO_FCALL                                      0  $5      
          7        IS_EQUAL                                         ~6      !0, $5
          8      > JMPZ_EX                                          ~6      ~6, ->13
          9    >   INIT_METHOD_CALL                                         !2, 'getLastName'
         10        DO_FCALL                                      0  $7      
         11        IS_EQUAL                                         ~8      !1, $7
         12        BOOL                                             ~6      ~8
         13    > > JMPZ                                                     ~6, ->18
  111    14    >   VERIFY_RETURN_TYPE                                       !2
         15        FE_FREE                                                  $4
         16      > RETURN                                                   !2
  112    17*       JMP                                                      ->19
  109    18    > > JMP                                                      ->4
         19    >   FE_FREE                                                  $4
  115    20      > JMPZ                                                     1, ->25
  116    21    >   NEW                                              $9      'Exception'
         22        SEND_VAL_EX                                              '%D0%9D%D0%B5%D0%BF%D1%80%D0%B0%D0%B2%D0%B8%D0%BB%D1%8C%D0%BD%D0%BE+%D0%B2%D0%B2%D0%B5%D0%B4%D0%B5%D0%BD%D1%8B+%D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D0%B5+%D0%BA%D0%BB%D0%B8%D0%B5%D0%BD%D1%82%D0%B0'
         23        DO_FCALL                                      0          
         24      > THROW                                         0          $9
  118    25    >   VERIFY_RETURN_TYPE                                       
         26      > RETURN                                                   null

End of function getguest

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

End of function getreceipts

Function adddateofreceipts:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ULIPK
function name:  addDateOfReceipts
number of ops:  6
compiled vars:  !0 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  125     0  E >   RECV                                             !0      
  127     1        FETCH_OBJ_W                                      $1      'receipts'
          2        FETCH_DIM_W                                      $2      $1, 'date'
          3        ASSIGN_DIM                                               $2
          4        OP_DATA                                                  !0
  128     5      > RETURN                                                   null

End of function adddateofreceipts

Function addmoneyofreceipts:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ULIPK
function name:  addMoneyOfReceipts
number of ops:  6
compiled vars:  !0 = $money
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  130     0  E >   RECV                                             !0      
  132     1        FETCH_OBJ_W                                      $1      'receipts'
          2        FETCH_DIM_W                                      $2      $1, 'money'
          3        ASSIGN_DIM                                               $2
          4        OP_DATA                                                  !0
  133     5      > RETURN                                                   null

End of function addmoneyofreceipts

Function replenishmoney:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ULIPK
function name:  replenishMoney
number of ops:  7
compiled vars:  !0 = $money, !1 = $numberInArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  135     0  E >   RECV                                             !0      
          1        RECV                                             !1      
  137     2        FETCH_OBJ_RW                                     $2      'receipts'
          3        FETCH_DIM_RW                                     $3      $2, 'money'
          4        ASSIGN_DIM_OP                +=               1          $3, !1
          5        OP_DATA                                                  !0
  138     6      > RETURN                                                   null

End of function replenishmoney

End of class Hotel.

Class Guest:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ULIPK
function name:  __construct
number of ops:  7
compiled vars:  !0 = $firstName, !1 = $lastName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  147     0  E >   RECV                                             !0      
          1        RECV                                             !1      
  149     2        ASSIGN_OBJ                                               'firstName'
          3        OP_DA

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.35 ms | 1031 KiB | 14 Q