3v4l.org

run code in 300+ PHP versions simultaneously
<?php class HotelFee extends Hydratable { private $description; protected function hydrate(&$res) { if(isset($res) && $res!='') { $this->description = $res; unset($res); } } public function getDescription() { $this->checkHydation(); return $this->description; } } class HotelFees extends \ArrayIterator { function __construct(array &$res = array()) { if (count($res)) { foreach($res as $i => &$hotelFee) { $this->append(new HotelFee($hotelFee)); if(!count($hotelFee)) unset($res[$i]); } if(!count($res)) unset($res); } } /** * @return HotelFee */ public function getNext() { $o = $this->current(); $this->next(); return $o; } } $array = array("prova","ciao","hello"); $hotelFees = new HotelFees($array); //$hotelFees->rewind(); echo $hotelFees->count();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/N4MjA
function name:  (null)
number of ops:  10
compiled vars:  !0 = $array, !1 = $hotelFees
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'hotelfee', 'hydratable'
   44     1        ASSIGN                                                   !0, <array>
   45     2        NEW                                              $3      'HotelFees'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $3
   48     6        INIT_METHOD_CALL                                         !1, 'count'
          7        DO_FCALL                                      0  $6      
          8        ECHO                                                     $6
          9      > RETURN                                                   1

Class HotelFee:
Function hydrate:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
Branch analysis from position: 5
filename:       /in/N4MjA
function name:  hydrate
number of ops:  10
compiled vars:  !0 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ISSET_ISEMPTY_CV                                 ~1      !0
          2      > JMPZ_EX                                          ~1      ~1, ->5
          3    >   IS_NOT_EQUAL                                     ~2      !0, ''
          4        BOOL                                             ~1      ~2
          5    > > JMPZ                                                     ~1, ->9
    8     6    >   ASSIGN_OBJ                                               'description'
          7        OP_DATA                                                  !0
    9     8        UNSET_CV                                                 !0
   11     9    > > RETURN                                                   null

End of function hydrate

Function getdescription:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/N4MjA
function name:  getDescription
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_METHOD_CALL                                         'checkHydation'
          1        DO_FCALL                                      0          
   15     2        FETCH_OBJ_R                                      ~1      'description'
          3      > RETURN                                                   ~1
   16     4*     > RETURN                                                   null

End of function getdescription

End of class HotelFee.

Class HotelFees:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 22
Branch analysis from position: 3
2 jumps found. (Code = 125) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
2 jumps found. (Code = 126) Position 1 = 5, Position 2 = 17
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 16
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 22
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
Branch analysis from position: 17
Branch analysis from position: 22
filename:       /in/N4MjA
function name:  __construct
number of ops:  23
compiled vars:  !0 = $res, !1 = $hotelFee, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV_INIT                                        !0      <array>
   23     1        COUNT                                            ~3      !0
          2      > JMPZ                                                     ~3, ->22
   24     3    > > FE_RESET_RW                                      $4      !0, ->17
          4    > > FE_FETCH_RW                                      ~5      $4, !1, ->17
          5    >   ASSIGN                                                   !2, ~5
   25     6        INIT_METHOD_CALL                                         'append'
          7        NEW                                              $7      'HotelFee'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        SEND_VAR_NO_REF_EX                                       $7
         11        DO_FCALL                                      0          
   26    12        COUNT                                            ~10     !1
         13        BOOL_NOT                                         ~11     ~10
         14      > JMPZ                                                     ~11, ->16
   27    15    >   UNSET_DIM                                                !0, !2
   24    16    > > JMP                                                      ->4
         17    >   FE_FREE                                                  $4
   29    18        COUNT                                            ~12     !0
         19        BOOL_NOT                                         ~13     ~12
         20      > JMPZ                                                     ~13, ->22
   30    21    >   UNSET_CV                                                 !0
   32    22    > > RETURN                                                   null

End of function __construct

Function getnext:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/N4MjA
function name:  getNext
number of ops:  7
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   INIT_METHOD_CALL                                         'current'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   39     3        INIT_METHOD_CALL                                         'next'
          4        DO_FCALL                                      0          
   40     5      > RETURN                                                   !0
   41     6*     > RETURN                                                   null

End of function getnext

End of class HotelFees.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.1 ms | 1403 KiB | 13 Q