<?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
);
- Output for 7.3.1
- Time: 0.13323998451233, Memory: 40MB
- Output for 7.3.0
- Time: 0.10938405990601, Memory: 40MB
- Output for 7.2.13
- Time: 0.091992139816284, Memory: 40MB
- Output for 7.2.12
- Time: 0.073499202728271, Memory: 40MB
- Output for 7.2.11
- Time: 0.085559844970703, Memory: 40MB
- Output for 7.2.10
- Time: 0.098088026046753, Memory: 40MB
- Output for 7.2.9
- Time: 0.17096209526062, Memory: 40MB
- Output for 7.2.8
- Time: 0.10952091217041, Memory: 40MB
- Output for 7.2.7
- Time: 0.14375305175781, Memory: 40MB
- Output for 7.2.6
- Time: 0.13577198982239, Memory: 40MB
- Output for 7.2.5
- Time: 0.13849592208862, Memory: 40MB
- Output for 7.2.4
- Time: 0.26062393188477, Memory: 40MB
- Output for 7.2.3
- Time: 0.21658396720886, Memory: 40MB
- Output for 7.2.2
- Time: 0.12069201469421, Memory: 40MB
- Output for 7.2.1
- Time: 0.12574100494385, Memory: 40MB
- Output for 7.2.0
- Time: 0.18535208702087, Memory: 40MB
- Output for 7.1.25
- Time: 0.134192943573, Memory: 40MB
- Output for 7.1.7
- Time: 0.024574995040894, Memory: 40MB
- Output for 7.1.6
- Time: 0.028779983520508, Memory: 40MB
- Output for 7.1.5
- Time: 0.26311612129211, Memory: 40MB
- Output for 7.1.4
- Time: 0.47401404380798, Memory: 40MB
- Output for 7.1.3
- Time: 0.22906684875488, Memory: 40MB
- Output for 7.1.2
- Time: 0.29602003097534, Memory: 40MB
- Output for 7.1.1
- Time: 0.4264988899231, Memory: 40MB
- Output for 7.1.0
- Time: 0.45766806602478, Memory: 40MB
- Output for 7.0.20
- Time: 0.050546884536743, Memory: 40MB
- Output for 7.0.19
- Time: 0.66496014595032, Memory: 40MB
- Output for 7.0.18
- Time: 0.14000105857849, Memory: 40MB
- Output for 7.0.17
- Time: 0.51032686233521, Memory: 40MB
- Output for 7.0.16
- Time: 0.12619709968567, Memory: 40MB
- Output for 7.0.15
- Time: 0.35578203201294, Memory: 40MB
- Output for 7.0.14
- Time: 0.26892304420471, Memory: 40MB
- Output for 7.0.13
- Time: 0.5739278793335, Memory: 40MB
- Output for 7.0.12
- Time: 0.21292686462402, Memory: 40MB
- Output for 7.0.11
- Time: 0.21643686294556, Memory: 40MB
- Output for 7.0.10
- Time: 0.65580105781555, Memory: 40MB
- Output for 7.0.9
- Time: 0.46488189697266, Memory: 40MB
- Output for 7.0.8
- Time: 0.82728981971741, Memory: 40MB
- Output for 7.0.7
- Time: 0.17301487922668, Memory: 40MB
- Output for 7.0.6
- Time: 0.18870115280151, Memory: 40MB
- Output for 7.0.5
- Time: 0.52259397506714, Memory: 40MB
- Output for 7.0.4
- Time: 0.22385096549988, Memory: 40MB
- Output for 7.0.3
- Time: 0.19519400596619, Memory: 40MB
- Output for 7.0.2
- Time: 1.0500321388245, Memory: 40MB
- Output for 7.0.1
- Time: 1.198627948761, Memory: 40MB
- Output for 7.0.0
- Time: 0.88999080657959, Memory: 40MB
preferences:
78.75 ms | 401 KiB | 51 Q