3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // Initial Configuration global $aHash; $i = 0; $tmp = ''; while($i < 10000) { $tmp .= 'a'; ++$i; } $aHash = array_fill(100000000000000000000000, 100, $tmp); unset($i, $tmp); // Test Source function Test2_1() { global $aHash; /* The Test */ $t = microtime(true); reset($aHash); foreach($aHash as &$val) $val .= "a"; return (microtime(true) - $t); } // Test Source function Test2_3() { global $aHash; /* The Test */ $t = microtime(true); $key = array_keys($aHash); $size = sizeOf($key); for ($i=0; $i<$size; $i++) $aHash[$key[$i]] .= "a"; return (microtime(true) - $t); } // Variable Clean-up function Test2_End() { global $aHash; unset($aHash); } var_dump(Test2_1()); var_dump(Test2_3()); ?>
based on UkjcZ
Output for 7.0.2, 7.1.0
Warning: array_fill() expects parameter 1 to be integer, float given in /in/9IkJi on line 11 Warning: reset() expects parameter 1 to be array, null given in /in/9IkJi on line 20 Warning: Invalid argument supplied for foreach() in /in/9IkJi on line 21 float(9.0599060058594E-6) Warning: array_keys() expects parameter 1 to be array, null given in /in/9IkJi on line 32 float(4.0531158447266E-6)
Output for 7.0.14
Warning: array_fill() expects parameter 1 to be integer, float given in /in/9IkJi on line 11 Warning: reset() expects parameter 1 to be array, null given in /in/9IkJi on line 20 Warning: Invalid argument supplied for foreach() in /in/9IkJi on line 21 float(7.8678131103516E-6) Warning: array_keys() expects parameter 1 to be array, null given in /in/9IkJi on line 32 float(4.0531158447266E-6)
Output for 7.0.6
Warning: array_fill() expects parameter 1 to be integer, float given in /in/9IkJi on line 11 Warning: reset() expects parameter 1 to be array, null given in /in/9IkJi on line 20 Warning: Invalid argument supplied for foreach() in /in/9IkJi on line 21 float(5.9604644775391E-6) Warning: array_keys() expects parameter 1 to be array, null given in /in/9IkJi on line 32 float(3.0994415283203E-6)
Output for 7.0.5
Warning: array_fill() expects parameter 1 to be integer, float given in /in/9IkJi on line 11 Warning: reset() expects parameter 1 to be array, null given in /in/9IkJi on line 20 Warning: Invalid argument supplied for foreach() in /in/9IkJi on line 21 float(4.0531158447266E-6) Warning: array_keys() expects parameter 1 to be array, null given in /in/9IkJi on line 32 float(1.9073486328125E-6)
Output for 7.0.4
Warning: array_fill() expects parameter 1 to be integer, float given in /in/9IkJi on line 11 Warning: reset() expects parameter 1 to be array, null given in /in/9IkJi on line 20 Warning: Invalid argument supplied for foreach() in /in/9IkJi on line 21 float(7.1525573730469E-6) Warning: array_keys() expects parameter 1 to be array, null given in /in/9IkJi on line 32 float(3.0994415283203E-6)
Output for 7.0.3
Warning: array_fill() expects parameter 1 to be integer, float given in /in/9IkJi on line 11 Warning: reset() expects parameter 1 to be array, null given in /in/9IkJi on line 20 Warning: Invalid argument supplied for foreach() in /in/9IkJi on line 21 float(6.9141387939453E-6) Warning: array_keys() expects parameter 1 to be array, null given in /in/9IkJi on line 32 float(2.8610229492188E-6)
Output for 7.0.1
Warning: array_fill() expects parameter 1 to be integer, float given in /in/9IkJi on line 11 Warning: reset() expects parameter 1 to be array, null given in /in/9IkJi on line 20 Warning: Invalid argument supplied for foreach() in /in/9IkJi on line 21 float(5.9604644775391E-6) Warning: array_keys() expects parameter 1 to be array, null given in /in/9IkJi on line 32 float(4.0531158447266E-6)
Output for 7.0.0
Warning: array_fill() expects parameter 1 to be integer, float given in /in/9IkJi on line 11 Warning: reset() expects parameter 1 to be array, null given in /in/9IkJi on line 20 Warning: Invalid argument supplied for foreach() in /in/9IkJi on line 21 float(6.9141387939453E-6) Warning: array_keys() expects parameter 1 to be array, null given in /in/9IkJi on line 32 float(3.0994415283203E-6)
Output for 5.6.28
float(0.00039911270141602) float(3.504753112793E-5)
Output for 5.6.21
float(0.0004889965057373) float(3.504753112793E-5)
Output for 5.6.20
float(0.00035309791564941) float(2.3126602172852E-5)
Output for 5.6.19
float(0.00035190582275391) float(2.3126602172852E-5)
Output for 5.6.18
float(0.00042104721069336) float(3.504753112793E-5)
Output for 5.6.17
float(0.00042986869812012) float(2.598762512207E-5)
Output for 5.6.16
float(0.00038385391235352) float(3.814697265625E-5)
Output for 5.6.15
float(0.00042819976806641) float(3.0994415283203E-5)
Output for 5.6.14
float(0.00028896331787109) float(2.2172927856445E-5)
Output for 5.6.13
float(0.00029516220092773) float(2.0980834960938E-5)
Output for 5.6.12
float(0.00049996376037598) float(4.6968460083008E-5)
Output for 5.6.11
float(0.00056791305541992) float(5.1021575927734E-5)
Output for 5.6.10
float(0.00050497055053711) float(3.504753112793E-5)
Output for 5.6.9
float(0.00049018859863281) float(3.3140182495117E-5)
Output for 5.6.8
float(0.00042104721069336) float(2.7894973754883E-5)
Output for 5.6.7
float(0.00032210350036621) float(2.288818359375E-5)
Output for 5.5.35
float(0.0004889965057373) float(3.2901763916016E-5)
Output for 5.5.34
float(0.00046896934509277) float(5.4836273193359E-5)
Output for 5.5.33
float(0.00045108795166016) float(3.2186508178711E-5)
Output for 5.5.32
float(0.00043892860412598) float(4.7922134399414E-5)
Output for 5.5.31
float(0.00058197975158691) float(5.6982040405273E-5)
Output for 5.5.30
float(0.00049090385437012) float(3.504753112793E-5)
Output for 5.5.29
float(0.00031900405883789) float(2.3841857910156E-5)
Output for 5.5.28
float(0.00052094459533691) float(5.2928924560547E-5)
Output for 5.5.27
float(0.00031709671020508) float(2.3841857910156E-5)
Output for 5.5.26
float(0.00047397613525391) float(3.4093856811523E-5)
Output for 5.5.25
float(0.0008089542388916) float(5.4121017456055E-5)
Output for 5.5.24
float(0.0004270076751709) float(3.0040740966797E-5)
Output for 5.4.45
float(0.00058507919311523) float(4.3153762817383E-5)
Output for 5.4.44
float(0.00094008445739746) float(6.6041946411133E-5)
Output for 5.4.43
float(0.00057792663574219) float(3.6954879760742E-5)
Output for 5.4.42
float(0.00066089630126953) float(4.2915344238281E-5)
Output for 5.4.41
float(0.00057697296142578) float(4.1007995605469E-5)
Output for 5.4.40
float(0.00066685676574707) float(4.1961669921875E-5)
Output for 5.4.39
float(0.00076103210449219) float(5.793571472168E-5)
Output for 5.4.38
float(0.00069499015808105) float(4.6968460083008E-5)
Output for 5.4.37
float(0.00070595741271973) float(4.6014785766602E-5)
Output for 5.4.36
float(0.0005791187286377) float(4.1007995605469E-5)
Output for 5.4.35
float(0.00062084197998047) float(4.1961669921875E-5)
Output for 5.4.34
float(0.00031113624572754) float(2.7894973754883E-5)
Output for 5.4.32
float(0.00028491020202637) float(2.598762512207E-5)
Output for 5.4.31
float(0.00028300285339355) float(3.0040740966797E-5)
Output for 5.4.30
float(0.00044488906860352) float(2.7894973754883E-5)
Output for 5.4.29
float(0.00030899047851562) float(3.0994415283203E-5)
Output for 5.4.28
float(0.00026798248291016) float(2.598762512207E-5)
Output for 5.4.27
float(0.00026893615722656) float(7.3909759521484E-5)
Output for 5.4.26
float(0.00028300285339355) float(2.6941299438477E-5)
Output for 5.4.25
float(0.00027012825012207) float(4.0054321289062E-5)
Output for 5.4.24
float(0.00030684471130371) float(2.8133392333984E-5)
Output for 5.4.23
float(0.00031304359436035) float(1.5020370483398E-5)
Output for 5.4.22
float(0.00029397010803223) float(2.4080276489258E-5)
Output for 5.4.21
float(0.00029301643371582) float(2.3126602172852E-5)
Output for 5.4.20
float(0.00031018257141113) float(2.6941299438477E-5)
Output for 5.4.19
float(0.00044488906860352) float(4.6968460083008E-5)
Output for 5.4.18
float(0.00030303001403809) float(2.7179718017578E-5)
Output for 5.4.17
float(0.00026702880859375) float(2.6941299438477E-5)
Output for 5.4.16
float(0.00027108192443848) float(2.8848648071289E-5)
Output for 5.4.15
float(0.00024080276489258) float(3.9100646972656E-5)
Output for 5.4.14
float(0.00028204917907715) float(2.598762512207E-5)
Output for 5.4.13
float(0.00026416778564453) float(2.7179718017578E-5)
Output for 5.4.12
float(0.0003049373626709) float(2.0980834960938E-5)
Output for 5.4.11
float(0.00029802322387695) float(2.6941299438477E-5)
Output for 5.4.10
float(0.00027894973754883) float(2.7894973754883E-5)
Output for 5.4.9
float(0.00030303001403809) float(4.1961669921875E-5)
Output for 5.4.8
float(0.00035405158996582) float(2.8848648071289E-5)
Output for 5.4.7
float(0.00028800964355469) float(3.6954879760742E-5)
Output for 5.4.6
float(0.00030684471130371) float(2.7179718017578E-5)
Output for 5.4.5
float(0.00027608871459961) float(2.6941299438477E-5)
Output for 5.4.4
float(0.00029802322387695) float(6.9141387939453E-6)
Output for 5.4.3
float(0.00026988983154297) float(2.7179718017578E-5)
Output for 5.4.2
float(0.00027799606323242) float(2.598762512207E-5)
Output for 5.4.1
float(0.00029993057250977) float(2.6941299438477E-5)
Output for 5.4.0
float(0.00027799606323242) float(2.8133392333984E-5)
Output for 5.3.29
float(0.00028800964355469) float(2.8133392333984E-5)
Output for 5.3.28
float(0.00031709671020508) float(1.9073486328125E-6)
Output for 5.3.27
float(0.00029301643371582) float(0)
Output for 5.3.26
float(0.00030517578125) float(1.7881393432617E-5)
Output for 5.3.25
float(0.00034093856811523) float(9.5367431640625E-7)
Output for 5.3.24
float(0.0002591609954834) float(0)
Output for 5.3.23
float(0.00030016899108887) float(9.5367431640625E-7)
Output for 5.3.22
float(0.00025606155395508) float(2.7894973754883E-5)
Output for 5.3.21
float(0.00032591819763184) float(2.7179718017578E-5)
Output for 5.3.20
float(0.00028896331787109) float(2.7894973754883E-5)
Output for 5.3.19
float(0.00029993057250977) float(2.598762512207E-5)
Output for 5.3.18
float(0.00030088424682617) float(2.6941299438477E-5)
Output for 5.3.17
float(0.00029087066650391) float(2.8133392333984E-5)
Output for 5.3.10, 5.3.16
float(0.00028800964355469) float(2.6941299438477E-5)
Output for 5.3.15
float(0.00026988983154297) float(2.7894973754883E-5)
Output for 5.3.14
float(0.00031590461730957) float(3.6001205444336E-5)
Output for 5.3.13
float(0.00029397010803223) float(2.6941299438477E-5)
Output for 5.3.12
float(0.00031185150146484) float(2.7894973754883E-5)
Output for 5.3.11
float(0.00030088424682617) float(2.7894973754883E-5)
Output for 5.3.9
float(0.00026607513427734) float(3.0994415283203E-5)
Output for 5.3.8
float(0.00030303001403809) float(2.7894973754883E-5)
Output for 5.3.7
float(0.00033283233642578) float(2.7894973754883E-5)
Output for 5.3.6
float(0.00029492378234863) float(2.7894973754883E-5)
Output for 5.3.5
float(0.00042080879211426) float(4.8160552978516E-5)
Output for 5.3.4
float(0.0002748966217041) float(2.7894973754883E-5)
Output for 5.3.3
float(0.00029301643371582) float(2.8848648071289E-5)
Output for 5.3.2
float(0.00028514862060547) float(2.7894973754883E-5)
Output for 5.3.1
float(0.00027108192443848) float(3.6954879760742E-5)
Output for 5.3.0
float(0.00029301643371582) float(2.6941299438477E-5)
Output for 5.2.17
float(0.00026607513427734) float(4.6014785766602E-5)
Output for 5.2.16
float(0.00028705596923828) float(2.9087066650391E-5)
Output for 5.2.15
float(0.0002751350402832) float(3.0994415283203E-5)
Output for 5.2.14
float(0.00028800964355469) float(3.504753112793E-5)
Output for 5.2.13
float(0.00025796890258789) float(4.1007995605469E-5)
Output for 5.2.12
float(0.00026893615722656) float(3.0994415283203E-5)
Output for 5.2.11
float(0.00027298927307129) float(3.0040740966797E-5)
Output for 5.2.10
float(0.00026798248291016) float(2.7894973754883E-5)
Output for 5.2.9
float(0.00028610229492188) float(2.7894973754883E-5)
Output for 5.2.8
float(0.00028395652770996) float(3.0040740966797E-5)
Output for 5.2.7
float(0.00029611587524414) float(2.6941299438477E-5)
Output for 5.2.6
float(0.00029897689819336) float(2.7894973754883E-5)
Output for 5.2.5
float(0.00029277801513672) float(3.3140182495117E-5)
Output for 5.2.4
float(0.00030612945556641) float(3.4093856811523E-5)
Output for 5.2.3
float(0.00027608871459961) float(3.6001205444336E-5)
Output for 5.2.2
float(0.00026702880859375) float(4.5061111450195E-5)
Output for 5.2.1
float(0.00027704238891602) float(4.3869018554688E-5)
Output for 5.2.0
float(0.00029706954956055) float(2.5033950805664E-5)
Output for 5.1.6
float(0.00024890899658203) float(4.1007995605469E-5)
Output for 5.1.5
float(0.00030112266540527) float(3.7193298339844E-5)
Output for 5.1.4
float(0.00029706954956055) float(3.9100646972656E-5)
Output for 5.1.3
float(0.00025105476379395) float(4.7922134399414E-5)
Output for 5.1.2
float(0.00030612945556641) float(4.6014785766602E-5)
Output for 5.1.1
float(0.00026392936706543) float(4.887580871582E-5)
Output for 5.1.0
float(0.00028705596923828) float(7.9154968261719E-5)
Output for 5.0.5
float(0.00035190582275391) float(0.00010299682617188)
Output for 5.0.4
float(0.00031089782714844) float(0.00011610984802246)
Output for 5.0.3
float(0.00030016899108887) float(8.7976455688477E-5)
Output for 5.0.2
float(0.00030708312988281) float(0.00017714500427246)
Output for 5.0.1
float(0.00027298927307129) float(5.8889389038086E-5)
Output for 5.0.0
float(0.00028705596923828) float(8.6069107055664E-5)
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '&', expecting T_VARIABLE or '$' in /in/9IkJi on line 21
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected '&', expecting T_VARIABLE or '$' in /in/9IkJi on line 21
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_VARIABLE' or `'$'' in /in/9IkJi on line 21
Process exited with code 255.