3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function ref(&$array) { foreach ($array as $item) { $item; } } function notref($array) { foreach ($array as $item) { $item; } } $array = range(0, 1000); $start = microtime(true); notref($array); echo 'time: '.(microtime(true) - $start).'sec | '; $start = microtime(true); ref($array); echo 'time: '.(microtime(true) - $start).'sec ';
based on nDe4S
Output for 7.2.6
time: 2.2172927856445E-5sec | time: 5.9604644775391E-6sec
Output for 7.2.0
time: 2.0980834960938E-5sec | time: 1.1920928955078E-5sec
Output for 7.1.10
time: 2.1934509277344E-5sec | time: 1.3113021850586E-5sec
Output for 7.1.7
time: 2.7179718017578E-5sec | time: 1.6927719116211E-5sec
Output for 7.0.0, 7.0.2, 7.1.6
time: 2.6941299438477E-5sec | time: 1.5974044799805E-5sec
Output for 7.1.5
time: 2.8133392333984E-5sec | time: 1.7166137695312E-5sec
Output for 7.1.4
time: 6.413459777832E-5sec | time: 1.6927719116211E-5sec
Output for 7.1.3
time: 1.8119812011719E-5sec | time: 1.0967254638672E-5sec
Output for 7.1.2
time: 1.5020370483398E-5sec | time: 1.0967254638672E-5sec
Output for 7.1.1
time: 2.4080276489258E-5sec | time: 1.5974044799805E-5sec
Output for 7.1.0
time: 2.3126602172852E-5sec | time: 1.7881393432617E-5sec
Output for 7.0.20
time: 2.0980834960938E-5sec | time: 1.0013580322266E-5sec
Output for 7.0.19
time: 1.8835067749023E-5sec | time: 1.0013580322266E-5sec
Output for 7.0.18
time: 2.7179718017578E-5sec | time: 1.0967254638672E-5sec
Output for 7.0.17
time: 1.9073486328125E-5sec | time: 1.0967254638672E-5sec
Output for 7.0.16
time: 1.6927719116211E-5sec | time: 1.0013580322266E-5sec
Output for 7.0.1, 7.0.14 - 7.0.15
time: 2.598762512207E-5sec | time: 1.5974044799805E-5sec
Output for 7.0.6, 7.0.13
time: 1.7881393432617E-5sec | time: 1.0013580322266E-5sec
Output for 7.0.12
time: 1.9073486328125E-5sec | time: 1.1205673217773E-5sec
Output for 7.0.11
time: 2.5033950805664E-5sec | time: 1.4066696166992E-5sec
Output for 7.0.10
time: 2.598762512207E-5sec | time: 1.0967254638672E-5sec
Output for 7.0.9
time: 1.9073486328125E-5sec | time: 2.6941299438477E-5sec
Output for 7.0.8
time: 2.598762512207E-5sec | time: 1.7166137695312E-5sec
Output for 7.0.7
time: 2.6941299438477E-5sec | time: 1.5020370483398E-5sec
Output for 7.0.5
time: 2.7179718017578E-5sec | time: 1.5020370483398E-5sec
Output for 7.0.4
time: 1.7881393432617E-5sec | time: 9.7751617431641E-6sec
Output for 7.0.3
time: 1.8119812011719E-5sec | time: 1.215934753418E-5sec
Output for hhvm-3.15.4
time: 8.6069107055664E-5sec | time: 9.918212890625E-5sec
Output for 5.6.30
time: 0.00019383430480957sec | time: 5.1021575927734E-5sec
Output for 5.6.29
time: 0.00012493133544922sec | time: 3.3855438232422E-5sec
Output for 5.6.28
time: 0.00018501281738281sec | time: 3.504753112793E-5sec
Output for 5.6.27
time: 0.00017189979553223sec | time: 4.5061111450195E-5sec
Output for 5.6.26
time: 0.00013899803161621sec | time: 3.504753112793E-5sec
Output for 5.6.25
time: 0.00017595291137695sec | time: 3.504753112793E-5sec
Output for 5.6.24
time: 0.00018501281738281sec | time: 4.7922134399414E-5sec
Output for 5.6.23
time: 0.00019001960754395sec | time: 5.1021575927734E-5sec
Output for 5.6.22
time: 0.00019192695617676sec | time: 8.6069107055664E-5sec
Output for 5.6.21
time: 0.00013113021850586sec | time: 3.7908554077148E-5sec
Output for 5.6.20
time: 0.0001981258392334sec | time: 5.1021575927734E-5sec
Output for 5.6.19
time: 0.00016999244689941sec | time: 3.2901763916016E-5sec
Output for 5.6.18
time: 0.00014185905456543sec | time: 4.7206878662109E-5sec
Output for 5.6.17
time: 0.00013995170593262sec | time: 3.2901763916016E-5sec
Output for 5.6.16
time: 0.00018310546875sec | time: 4.8160552978516E-5sec
Output for 5.6.15
time: 0.0001981258392334sec | time: 5.2928924560547E-5sec
Output for 5.6.14
time: 0.00013899803161621sec | time: 3.4093856811523E-5sec
Output for 5.6.13
time: 0.0001838207244873sec | time: 5.1975250244141E-5sec
Output for 5.6.12
time: 0.0002140998840332sec | time: 8.392333984375E-5sec
Output for 5.6.11
time: 0.00020098686218262sec | time: 9.2983245849609E-5sec
Output for 5.6.10
time: 0.00020718574523926sec | time: 7.7009201049805E-5sec
Output for 5.6.9
time: 0.00012588500976562sec | time: 3.2901763916016E-5sec
Output for 5.6.8
time: 0.00012516975402832sec | time: 4.3869018554688E-5sec
Output for 5.6.7
time: 0.00014805793762207sec | time: 4.6968460083008E-5sec
Output for 5.6.6
time: 0.00012302398681641sec | time: 3.2901763916016E-5sec
Output for 5.6.5
time: 0.00021600723266602sec | time: 4.2915344238281E-5sec
Output for 5.6.4
time: 0.00019192695617676sec | time: 4.887580871582E-5sec
Output for 5.6.3
time: 0.00019097328186035sec | time: 5.5074691772461E-5sec
Output for 5.6.2
time: 0.00012397766113281sec | time: 3.3140182495117E-5sec
Output for 5.6.1
time: 0.00014805793762207sec | time: 3.4093856811523E-5sec
Output for 5.6.0
time: 0.00012397766113281sec | time: 3.1948089599609E-5sec