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 $key=>$val) $aHash[$key] .= "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 Qlji3
Output for 7.1.0
Warning: array_fill() expects parameter 1 to be integer, float given in /in/UkjcZ on line 11 Warning: reset() expects parameter 1 to be array, null given in /in/UkjcZ on line 20 Warning: Invalid argument supplied for foreach() in /in/UkjcZ on line 21 float(8.1062316894531E-6) Warning: array_keys() expects parameter 1 to be array, null given in /in/UkjcZ on line 32 float(3.814697265625E-6)
Output for 7.0.14
Warning: array_fill() expects parameter 1 to be integer, float given in /in/UkjcZ on line 11 Warning: reset() expects parameter 1 to be array, null given in /in/UkjcZ on line 20 Warning: Invalid argument supplied for foreach() in /in/UkjcZ on line 21 float(1.0967254638672E-5) Warning: array_keys() expects parameter 1 to be array, null given in /in/UkjcZ on line 32 float(5.9604644775391E-6)
Output for 7.0.6
Warning: array_fill() expects parameter 1 to be integer, float given in /in/UkjcZ on line 11 Warning: reset() expects parameter 1 to be array, null given in /in/UkjcZ on line 20 Warning: Invalid argument supplied for foreach() in /in/UkjcZ on line 21 float(4.7683715820312E-6) Warning: array_keys() expects parameter 1 to be array, null given in /in/UkjcZ on line 32 float(2.8610229492188E-6)
Output for 7.0.2, 7.0.5
Warning: array_fill() expects parameter 1 to be integer, float given in /in/UkjcZ on line 11 Warning: reset() expects parameter 1 to be array, null given in /in/UkjcZ on line 20 Warning: Invalid argument supplied for foreach() in /in/UkjcZ on line 21 float(5.9604644775391E-6) Warning: array_keys() expects parameter 1 to be array, null given in /in/UkjcZ on line 32 float(3.0994415283203E-6)
Output for 7.0.4
Warning: array_fill() expects parameter 1 to be integer, float given in /in/UkjcZ on line 11 Warning: reset() expects parameter 1 to be array, null given in /in/UkjcZ on line 20 Warning: Invalid argument supplied for foreach() in /in/UkjcZ on line 21 float(3.814697265625E-6) Warning: array_keys() expects parameter 1 to be array, null given in /in/UkjcZ on line 32 float(9.5367431640625E-7)
Output for 7.0.3
Warning: array_fill() expects parameter 1 to be integer, float given in /in/UkjcZ on line 11 Warning: reset() expects parameter 1 to be array, null given in /in/UkjcZ on line 20 Warning: Invalid argument supplied for foreach() in /in/UkjcZ on line 21 float(5.0067901611328E-6) Warning: array_keys() expects parameter 1 to be array, null given in /in/UkjcZ on line 32 float(3.0994415283203E-6)
Output for 7.0.1
Warning: array_fill() expects parameter 1 to be integer, float given in /in/UkjcZ on line 11 Warning: reset() expects parameter 1 to be array, null given in /in/UkjcZ on line 20 Warning: Invalid argument supplied for foreach() in /in/UkjcZ on line 21 float(3.814697265625E-6) Warning: array_keys() expects parameter 1 to be array, null given in /in/UkjcZ on line 32 float(2.8610229492188E-6)
Output for 7.0.0
Warning: array_fill() expects parameter 1 to be integer, float given in /in/UkjcZ on line 11 Warning: reset() expects parameter 1 to be array, null given in /in/UkjcZ on line 20 Warning: Invalid argument supplied for foreach() in /in/UkjcZ on line 21 float(5.9604644775391E-6) Warning: array_keys() expects parameter 1 to be array, null given in /in/UkjcZ on line 32 float(4.0531158447266E-6)
Output for hhvm-3.12.0
float(0.00030899047851562) float(1.8119812011719E-5)
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.28
float(0.00040411949157715) float(3.2901763916016E-5)
Output for 5.6.21
float(0.00049901008605957) float(2.8133392333984E-5)
Output for 5.6.20
float(0.00045990943908691) float(4.1961669921875E-5)
Output for 5.6.19
float(0.00036382675170898) float(2.288818359375E-5)
Output for 5.6.18
float(0.00048017501831055) float(2.8848648071289E-5)
Output for 5.6.17
float(0.00045180320739746) float(3.9815902709961E-5)
Output for 5.6.16
float(0.00038504600524902) float(3.0994415283203E-5)
Output for 5.6.15
float(0.00039410591125488) float(3.1948089599609E-5)
Output for 5.6.14
float(0.00049185752868652) float(3.3855438232422E-5)
Output for 5.6.13
float(0.00034499168395996) float(2.0027160644531E-5)
Output for 5.6.12
float(0.00042510032653809) float(2.6941299438477E-5)
Output for 5.6.11
float(0.00034809112548828) float(2.0980834960938E-5)
Output for 5.6.10
float(0.00051116943359375) float(3.0994415283203E-5)
Output for 5.6.9
float(0.00034093856811523) float(2.8848648071289E-5)
Output for 5.6.8
float(0.00047397613525391) float(2.8133392333984E-5)
Output for 5.5.35
float(0.00050091743469238) float(2.9087066650391E-5)
Output for 5.5.34
float(0.00032806396484375) float(2.0980834960938E-5)
Output for 5.5.33
float(0.00030899047851562) float(1.978874206543E-5)
Output for 5.5.32
float(0.00032210350036621) float(2.0980834960938E-5)
Output for 5.5.31
float(0.0004279613494873) float(2.6941299438477E-5)
Output for 5.5.30
float(0.00047898292541504) float(3.4093856811523E-5)
Output for 5.5.29
float(0.0004580020904541) float(2.9087066650391E-5)
Output for 5.5.28
float(0.00046586990356445) float(2.7894973754883E-5)
Output for 5.5.27
float(0.00053715705871582) float(3.3140182495117E-5)
Output for 5.5.26
float(0.00041794776916504) float(2.5033950805664E-5)
Output for 5.5.25
float(0.00056910514831543) float(3.2901763916016E-5)
Output for 5.5.24
float(0.00043487548828125) float(2.598762512207E-5)
Output for 5.4.45
float(0.00061988830566406) float(3.504753112793E-5)
Output for 5.4.44
float(0.00068092346191406) float(3.814697265625E-5)
Output for 5.4.43
float(0.00097298622131348) float(5.6028366088867E-5)
Output for 5.4.42
float(0.00054097175598145) float(3.6001205444336E-5)
Output for 5.4.41
float(0.00069403648376465) float(3.6954879760742E-5)
Output for 5.4.40
float(0.00072002410888672) float(3.6001205444336E-5)
Output for 5.4.39
float(0.00078582763671875) float(3.6001205444336E-5)
Output for 5.4.38
float(0.00064802169799805) float(4.0054321289062E-5)
Output for 5.4.37
float(0.0016868114471436) float(0.00011706352233887)
Output for 5.4.36
float(0.00065493583679199) float(3.7908554077148E-5)
Output for 5.4.35
float(0.00069022178649902) float(4.0054321289062E-5)
Output for 5.4.34
float(0.00034689903259277) float(2.4080276489258E-5)
Output for 5.4.32
float(0.00035810470581055) float(2.598762512207E-5)
Output for 5.4.31
float(0.00029587745666504) float(3.504753112793E-5)
Output for 5.4.30
float(0.0003199577331543) float(2.1934509277344E-5)
Output for 5.4.29
float(0.0003669261932373) float(3.8862228393555E-5)
Output for 5.4.28
float(0.0003819465637207) float(3.4093856811523E-5)
Output for 5.4.27
float(0.00031709671020508) float(3.504753112793E-5)
Output for 5.4.26
float(0.00029110908508301) float(3.4809112548828E-5)
Output for 5.4.25
float(0.0003049373626709) float(2.0027160644531E-5)
Output for 5.4.24
float(0.00030183792114258) float(2.3841857910156E-5)
Output for 5.4.23
float(0.00026798248291016) float(2.4080276489258E-5)
Output for 5.4.22
float(0.00029492378234863) float(2.4080276489258E-5)
Output for 5.4.21
float(0.00030899047851562) float(4.2200088500977E-5)
Output for 5.4.20
float(0.00029706954956055) float(2.598762512207E-5)
Output for 5.4.19
float(0.00028204917907715) float(2.5033950805664E-5)
Output for 5.4.18
float(0.00030279159545898) float(2.5033950805664E-5)
Output for 5.4.17
float(0.00031304359436035) float(3.2901763916016E-5)
Output for 5.4.16
float(0.00032806396484375) float(2.3841857910156E-5)
Output for 5.4.15
float(0.00031685829162598) float(2.3841857910156E-5)
Output for 5.4.14
float(0.00032997131347656) float(2.3841857910156E-5)
Output for 5.4.13
float(0.00029492378234863) float(2.3841857910156E-5)
Output for 5.4.12
float(0.00030303001403809) float(2.5033950805664E-5)
Output for 5.4.11
float(0.00041389465332031) float(3.8862228393555E-5)
Output for 5.4.10
float(0.00029897689819336) float(2.6941299438477E-5)
Output for 5.4.9
float(0.00034999847412109) float(2.7179718017578E-5)
Output for 5.4.8
float(0.00029516220092773) float(2.4080276489258E-5)
Output for 5.4.7
float(0.00027680397033691) float(2.288818359375E-5)
Output for 5.4.6
float(0.00028800964355469) float(2.1934509277344E-5)
Output for 5.4.5
float(0.00026893615722656) float(2.4080276489258E-5)
Output for 5.4.4
float(0.00031495094299316) float(3.0040740966797E-5)
Output for 5.4.3
float(0.00033116340637207) float(2.7179718017578E-5)
Output for 5.3.7, 5.4.2
float(0.00029087066650391) float(2.5033950805664E-5)
Output for 5.4.1
float(0.00027894973754883) float(2.5033950805664E-5)
Output for 5.4.0
float(0.0003209114074707) float(2.8133392333984E-5)
Output for 5.3.29
float(0.00028014183044434) float(3.2901763916016E-5)
Output for 5.3.28
float(0.00026702880859375) float(2.5033950805664E-5)
Output for 5.3.27
float(0.00028300285339355) float(2.288818359375E-5)
Output for 5.3.26
float(0.00031495094299316) float(3.2186508178711E-5)
Output for 5.3.25
float(0.00042986869812012) float(3.7908554077148E-5)
Output for 5.3.23 - 5.3.24
float(0.00028586387634277) float(2.1934509277344E-5)
Output for 5.3.22
float(0.00029110908508301) float(2.4080276489258E-5)
Output for 5.3.21
float(0.00030422210693359) float(3.1948089599609E-5)
Output for 5.3.20
float(0.00029706954956055) float(2.4080276489258E-5)
Output for 5.3.19
float(0.00029683113098145) float(2.288818359375E-5)
Output for 5.3.18
float(0.00026893615722656) float(2.4795532226562E-5)
Output for 5.3.17
float(0.00028085708618164) float(3.2901763916016E-5)
Output for 5.3.16
float(0.0002899169921875) float(3.8862228393555E-5)
Output for 5.3.15
float(0.00026702880859375) float(2.3841857910156E-5)
Output for 5.3.14
float(0.00027108192443848) float(2.3841857910156E-5)
Output for 5.3.13
float(0.00027990341186523) float(2.8133392333984E-5)
Output for 5.3.12
float(0.00031900405883789) float(2.5033950805664E-5)
Output for 5.3.11
float(0.0002739429473877) float(2.4080276489258E-5)
Output for 5.3.10
float(0.00034308433532715) float(2.3126602172852E-5)
Output for 5.3.9
float(0.00033402442932129) float(2.0027160644531E-5)
Output for 5.3.8
float(0.00029301643371582) float(2.288818359375E-5)
Output for 5.3.6
float(0.0003049373626709) float(2.3126602172852E-5)
Output for 5.3.5
float(0.00029897689819336) float(2.288818359375E-5)
Output for 5.3.4
float(0.00031089782714844) float(2.5033950805664E-5)
Output for 5.3.3
float(0.00030303001403809) float(2.598762512207E-5)
Output for 5.3.2
float(0.00029993057250977) float(2.4795532226562E-5)
Output for 5.3.1
float(0.00027799606323242) float(2.0980834960938E-5)
Output for 5.3.0
float(0.0002751350402832) float(2.3126602172852E-5)
Output for 5.2.17
float(0.00029897689819336) float(3.1948089599609E-5)
Output for 5.2.16
float(0.00027012825012207) float(2.8133392333984E-5)
Output for 5.2.15
float(0.00029993057250977) float(2.8133392333984E-5)
Output for 5.2.14
float(0.00031113624572754) float(3.1948089599609E-5)
Output for 5.2.13
float(0.00032615661621094) float(3.8862228393555E-5)
Output for 5.2.12
float(0.00046396255493164) float(3.0040740966797E-5)
Output for 5.2.11
float(0.00031280517578125) float(3.2901763916016E-5)
Output for 5.2.10
float(0.00029492378234863) float(2.5033950805664E-5)
Output for 5.2.9
float(0.00027203559875488) float(2.5033950805664E-5)
Output for 5.2.8
float(0.0003361701965332) float(3.6954879760742E-5)
Output for 5.2.7
float(0.00030303001403809) float(5.4836273193359E-5)
Output for 5.2.6
float(0.00026512145996094) float(3.8862228393555E-5)
Output for 5.2.5
float(0.00029993057250977) float(5.1021575927734E-5)
Output for 5.2.4
float(0.00031590461730957) float(3.1948089599609E-5)
Output for 5.2.3
float(0.00046610832214355) float(5.3882598876953E-5)
Output for 5.2.2
float(0.00028085708618164) float(3.1948089599609E-5)
Output for 5.2.1
float(0.00029611587524414) float(2.3841857910156E-5)
Output for 5.2.0
float(0.00030207633972168) float(2.5033950805664E-5)
Output for 5.1.6
float(0.00033092498779297) float(3.6001205444336E-5)
Output for 5.1.5
float(0.00031495094299316) float(3.6954879760742E-5)
Output for 5.1.4
float(0.00030994415283203) float(3.6001205444336E-5)
Output for 5.1.3
float(0.00030207633972168) float(4.5061111450195E-5)
Output for 5.1.2
float(0.00030612945556641) float(4.6014785766602E-5)
Output for 5.1.1
float(0.00032186508178711) float(4.6014785766602E-5)
Output for 5.1.0
float(0.00029182434082031) float(3.7908554077148E-5)
Output for 5.0.5
float(0.00034093856811523) float(5.8889389038086E-5)
Output for 5.0.4
float(0.00034499168395996) float(6.2942504882813E-5)
Output for 5.0.3
float(0.0003209114074707) float(6.5088272094727E-5)
Output for 5.0.2
float(0.00034189224243164) float(9.1075897216797E-5)
Output for 5.0.1
float(0.00034189224243164) float(6.0081481933594E-5)
Output for 5.0.0
float(0.00032591819763184) float(5.6982040405273E-5)
Output for 4.4.9
float(0.000336) float(8.5000000000002E-5)
Output for 4.4.8
float(0.00033) float(6.9999999999959E-5)
Output for 4.4.7
float(0.00043199999999999) float(6.8000000000012E-5)
Output for 4.4.6
float(0.00037600000000004) float(5.9000000000031E-5)
Output for 4.4.5
float(0.00033499999999997) float(7.4000000000018E-5)
Output for 4.4.4
float(0.000359) float(6.8000000000068E-5)
Output for 4.4.3
float(0.00032699999999997) float(7.1999999999961E-5)
Output for 4.4.2
float(0.00033099999999997) float(5.8000000000002E-5)
Output for 4.4.1
float(0.00043099999999996) float(8.6999999999948E-5)
Output for 4.4.0
float(0.00032100000000002) float(5.3000000000081E-5)
Output for 4.3.11
float(0.00036500000000006) float(5.6999999999974E-5)
Output for 4.3.10
float(0.00037399999999999) float(6.3999999999953E-5)
Output for 4.3.9
float(0.00051299999999999) float(9.300000000001E-5)
Output for 4.3.8
float(0.00041900000000006) float(5.8000000000002E-5)
Output for 4.3.7
float(0.00044100000000002) float(9.5000000000067E-5)
Output for 4.3.6
float(0.00040400000000007) float(5.9000000000031E-5)
Output for 4.3.5
float(0.00034100000000004) float(6.3999999999953E-5)
Output for 4.3.4
float(0.00043700000000002) float(6.000000000006E-5)
Output for 4.3.3
float(0.00056199999999995) float(9.9999999999989E-5)
Output for 4.3.2
float(0.00041899999999995) float(8.3000000000055E-5)
Output for 4.3.1
float(0.00037399999999999) float(6.8999999999986E-5)
Output for 4.3.0
float(0.00082800000000005) float(9.899999999996E-5)