3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { private $vars = array(); public function __construct() {} public function __get($id) { return array_key_exists($id, $this->vars) ? $this->vars[$id] : null; } public function __set($id, $val) { $this->vars[$id] = $val; } } $ta = microtime(true); $ma = memory_get_usage(); $c = new A(); for ($i=0;$i<10000;$i++) { $a = clone $c; $a->klucz = 'wartosc'.$i; $a->hash = md5(microtime(true)); } $tb = microtime(true); $mb = memory_get_usage(); $tc = $tb-$ta; $mc = $mb-$ma; var_dump($tc, $mc);
based on jMkFs
Output for 7.2.0
float(0.01016092300415) int(640)
Output for 7.1.10
float(0.016937971115112) int(640)
Output for 7.1.7
float(0.01207709312439) int(640)
Output for 7.1.6
float(0.020378112792969) int(640)
Output for 7.1.5
float(0.02057409286499) int(640)
Output for 7.1.0
float(0.015590906143188) int(640)
Output for 7.0.20
float(0.010612010955811) int(1032)
Output for 7.0.6
float(0.011811971664429) int(1032)
Output for 7.0.5
float(0.015115976333618) int(1032)
Output for 7.0.4
float(0.011180877685547) int(1032)
Output for 7.0.3
float(0.010281085968018) int(1032)
Output for 7.0.2
float(0.0099620819091797) int(1032)
Output for 7.0.1
float(0.014374017715454) int(1032)
Output for 7.0.0
float(0.010001182556152) int(1032)
Output for 5.6.28
float(0.027166128158569) int(1872)
Output for 5.6.21
float(0.021226167678833) int(1872)
Output for 5.6.20
float(0.015479803085327) int(1872)
Output for 5.6.19
float(0.023705005645752) int(1872)
Output for 5.6.18
float(0.020220041275024) int(1872)
Output for 5.6.17
float(0.016080141067505) int(1872)
Output for 5.6.16
float(0.016000032424927) int(1872)
Output for 5.6.15
float(0.016002178192139) int(1872)
Output for 5.6.14
float(0.016735076904297) int(1872)
Output for 5.6.13
float(0.023164987564087) int(1872)
Output for 5.6.12
float(0.016294002532959) int(1872)
Output for 5.6.11
float(0.019929170608521) int(1872)
Output for 5.6.10
float(0.024060010910034) int(1872)
Output for 5.6.9
float(0.021703958511353) int(1872)
Output for 5.6.8
float(0.026592969894409) int(1872)
Output for 5.5.35
float(0.019404888153076) int(1872)
Output for 5.5.34
float(0.015506029129028) int(1872)
Output for 5.5.33
float(0.015000820159912) int(1872)
Output for 5.5.32
float(0.0223228931427) int(1872)
Output for 5.5.31
float(0.020587921142578) int(1872)
Output for 5.5.30
float(0.022938966751099) int(1872)
Output for 5.5.29
float(0.019394874572754) int(1872)
Output for 5.5.28
float(0.016393899917603) int(1872)
Output for 5.5.27
float(0.021687030792236) int(1872)
Output for 5.5.26
float(0.024515867233276) int(1872)
Output for 5.5.25
float(0.021981000900269) int(1872)
Output for 5.5.24
float(0.014472007751465) int(1872)
Output for 5.4.45
float(0.026583909988403) int(1864)
Output for 5.4.44
float(0.027870178222656) int(1864)
Output for 5.4.43
float(0.038220882415771) int(1864)
Output for 5.4.42
float(0.027729034423828) int(1864)
Output for 5.4.41
float(0.030730962753296) int(1864)
Output for 5.4.40
float(0.030858993530273) int(1864)
Output for 5.4.39
float(0.028295040130615) int(1864)
Output for 5.4.38
float(0.028347969055176) int(1864)
Output for 5.4.37
float(0.032923936843872) int(1864)
Output for 5.4.36
float(0.02872109413147) int(1864)
Output for 5.4.35
float(0.029582977294922) int(1864)
Output for 5.4.34
float(0.027064085006714) int(1864)
Output for 5.4.32
float(0.028913974761963) int(1864)
Output for 5.4.31
float(0.027105808258057) int(1864)
Output for 5.4.30
float(0.030704975128174) int(1864)
Output for 5.4.29
float(0.027647018432617) int(1864)
Output for 5.4.28
float(0.034404993057251) int(1864)
Output for 5.4.27
float(0.028066873550415) int(1864)
Output for 5.4.26
float(0.029935836791992) int(1864)
Output for 5.4.25
float(0.029932975769043) int(1864)
Output for 5.4.24
float(0.027214050292969) int(1864)
Output for 5.4.23
float(0.028929948806763) int(1864)
Output for 5.4.22
float(0.02870512008667) int(1864)
Output for 5.4.21
float(0.031579971313477) int(1864)
Output for 5.4.20
float(0.029949903488159) int(1864)
Output for 5.4.19
float(0.027935028076172) int(1864)
Output for 5.4.18
float(0.02997088432312) int(1864)
Output for 5.4.17
float(0.02665901184082) int(1864)
Output for 5.4.16
float(0.027953147888184) int(1864)
Output for 5.4.15
float(0.027955055236816) int(1864)
Output for 5.4.14
float(0.028884172439575) int(1864)
Output for 5.4.13
float(0.030543088912964) int(1864)
Output for 5.4.12
float(0.029078960418701) int(1864)
Output for 5.4.11
float(0.028485059738159) int(1864)
Output for 5.3.29
float(0.035791158676147) int(2344)
Output for 5.3.28
float(0.034728050231934) int(2344)
Output for 5.3.27
float(0.039022922515869) int(2344)
Output for 5.3.26
float(0.037484884262085) int(2344)
Output for 5.3.25
float(0.039740085601807) int(2344)
Output for 5.3.24
float(0.052572011947632) int(2344)
Output for 5.3.23
float(0.037049055099487) int(2344)
Output for 5.3.22
float(0.036761045455933) int(2344)
Output for 5.3.21
float(0.037825107574463) int(2344)