3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Region { protected $city; protected $country; protected $cityCode; protected $countryCode; /** * @return mixed */ public function getCity() { return $this->city; } /** * @param mixed $city */ public function setCity($city) { $this->city = $city; } /** * @return mixed */ public function getCountry() { return $this->country; } /** * @param mixed $country */ public function setCountry($country) { $this->country = $country; } /** * @return mixed */ public function getCityCode() { return $this->cityCode; } /** * @param mixed $cityCode */ public function setCityCode($cityCode) { $this->cityCode = $cityCode; } /** * @return mixed */ public function getCountryCode() { return $this->countryCode; } /** * @param mixed $countryCode */ public function setCountryCode($countryCode) { $this->countryCode = $countryCode; } } $time = microtime(true); $memory = memory_get_usage(true); $collection = []; $randSrtring = hash_hmac('md5',rand(0, 1000), 'some key'); for ($i = 0; $i <= 100000; $i++) { $region = []; $region['city'] = $randSrtring; $region['city_code'] = $randSrtring; $region['country'] = $randSrtring; $region['country_code'] = $randSrtring; array_push($collection, $region); } $resultTime = @(microtime(true) - $time); $resultMemory = @round((memory_get_usage(true) - $memory) / (1024 * 1024)); echo sprintf( "Time: %s, Memory: %sMB", $resultTime, $resultMemory );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 21
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 21
Branch analysis from position: 37
Branch analysis from position: 21
filename:       /in/ROIq5
function name:  (null)
number of ops:  62
compiled vars:  !0 = $time, !1 = $memory, !2 = $collection, !3 = $randSrtring, !4 = $i, !5 = $region, !6 = $resultTime, !7 = $resultMemory
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   75     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $8      
          3        ASSIGN                                                   !0, $8
   76     4        INIT_FCALL                                               'memory_get_usage'
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $10     
          7        ASSIGN                                                   !1, $10
   78     8        ASSIGN                                                   !2, <array>
   79     9        INIT_FCALL                                               'hash_hmac'
         10        SEND_VAL                                                 'md5'
         11        INIT_FCALL                                               'rand'
         12        SEND_VAL                                                 0
         13        SEND_VAL                                                 1000
         14        DO_ICALL                                         $13     
         15        SEND_VAR                                                 $13
         16        SEND_VAL                                                 'some+key'
         17        DO_ICALL                                         $14     
         18        ASSIGN                                                   !3, $14
   81    19        ASSIGN                                                   !4, 0
         20      > JMP                                                      ->35
   82    21    >   ASSIGN                                                   !5, <array>
   83    22        ASSIGN_DIM                                               !5, 'city'
         23        OP_DATA                                                  !3
   84    24        ASSIGN_DIM                                               !5, 'city_code'
         25        OP_DATA                                                  !3
   85    26        ASSIGN_DIM                                               !5, 'country'
         27        OP_DATA                                                  !3
   86    28        ASSIGN_DIM                                               !5, 'country_code'
         29        OP_DATA                                                  !3
   87    30        INIT_FCALL                                               'array_push'
         31        SEND_REF                                                 !2
         32        SEND_VAR                                                 !5
         33        DO_ICALL                                                 
   81    34        PRE_INC                                                  !4
         35    >   IS_SMALLER_OR_EQUAL                                      !4, 100000
         36      > JMPNZ                                                    ~24, ->21
   90    37    >   BEGIN_SILENCE                                    ~25     
         38        INIT_FCALL                                               'microtime'
         39        SEND_VAL                                                 <true>
         40        DO_ICALL                                         $26     
         41        SUB                                              ~27     $26, !0
         42        END_SILENCE                                              ~25
         43        ASSIGN                                                   !6, ~27
   91    44        BEGIN_SILENCE                                    ~29     
         45        INIT_FCALL                                               'round'
         46        INIT_FCALL                                               'memory_get_usage'
         47        SEND_VAL                                                 <true>
         48        DO_ICALL                                         $30     
         49        SUB                                              ~31     $30, !1
         50        DIV                                              ~32     ~31, 1048576
         51        SEND_VAL                                                 ~32
         52        DO_ICALL                                         $33     
         53        END_SILENCE                                              ~29
         54        ASSIGN                                                   !7, $33
   93    55        INIT_FCALL                                               'sprintf'
   94    56        SEND_VAL                                                 'Time%3A+%25s%2C+Memory%3A+%25sMB'
   95    57        SEND_VAR                                                 !6
   96    58        SEND_VAR                                                 !7
         59        DO_ICALL                                         $35     
         60        ECHO                                                     $35
   97    61      > RETURN                                                   1

Class Region:
Function getcity:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ROIq5
function name:  getCity
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   FETCH_OBJ_R                                      ~0      'city'
          1      > RETURN                                                   ~0
   16     2*     > RETURN                                                   null

End of function getcity

Function setcity:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ROIq5
function name:  setCity
number of ops:  4
compiled vars:  !0 = $city
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
   23     1        ASSIGN_OBJ                                               'city'
          2        OP_DATA                                                  !0
   24     3      > RETURN                                                   null

End of function setcity

Function getcountry:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ROIq5
function name:  getCountry
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   FETCH_OBJ_R                                      ~0      'country'
          1      > RETURN                                                   ~0
   32     2*     > RETURN                                                   null

End of function getcountry

Function setcountry:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ROIq5
function name:  setCountry
number of ops:  4
compiled vars:  !0 = $country
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   37     0  E >   RECV                                             !0      
   39     1        ASSIGN_OBJ                                               'country'
          2        OP_DATA                                                  !0
   40     3      > RETURN                                                   null

End of function setcountry

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

End of function getcitycode

Function setcitycode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ROIq5
function name:  setCityCode
number of ops:  4
compiled vars:  !0 = $cityCode
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   53     0  E >   RECV                                             !0      
   55     1        ASSIGN_OBJ                                               'cityCode'
          2        OP_DATA                                                  !0
   56     3      > RETURN                                                   null

End of function setcitycode

Function getcountrycode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ROIq5
function name:  getCountryCode
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   63     0  E >   FETCH_OBJ_R                                      ~0      'countryCode'
          1      > RETURN                                                   ~0
   64     2*     > RETURN                                                   null

End of function getcountrycode

Function setcountrycode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ROIq5
function name:  setCountryCode
number of ops:  4
compiled vars:  !0 = $countryCode
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   69     0  E >   RECV                                             !0      
   71     1        ASSIGN_OBJ                                               'countryCode'
          2        OP_DATA                                                  !0
   72     3      > RETURN                                                   null

End of function setcountrycode

End of class Region.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.65 ms | 1404 KiB | 27 Q