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); ref($array); echo 'time: '.(microtime(true) - $start).' sec'; $start = microtime(true); notref($array); echo 'time: '.(microtime(true) - $start).' sec';
based on Y5YJn
Output for 7.2.6
time: 1.5020370483398E-5 sectime: 6.9141387939453E-6 sec
Output for 7.2.0
time: 1.9073486328125E-5 sectime: 6.9141387939453E-6 sec
Output for 7.0.1, 7.1.10
time: 2.0980834960938E-5 sectime: 1.5974044799805E-5 sec
Output for 7.1.7
time: 1.5974044799805E-5 sectime: 1.5974044799805E-5 sec
Output for 7.1.6
time: 2.3126602172852E-5 sectime: 1.6927719116211E-5 sec
Output for 7.1.5
time: 2.0027160644531E-5 sectime: 2.0027160644531E-5 sec
Output for 7.1.4
time: 2.288818359375E-5 sectime: 2.5033950805664E-5 sec
Output for 7.1.3
time: 1.5020370483398E-5 sectime: 1.3828277587891E-5 sec
Output for 7.1.2
time: 1.8835067749023E-5 sectime: 2.3126602172852E-5 sec
Output for 7.1.1
time: 1.6927719116211E-5 sectime: 2.0980834960938E-5 sec
Output for 7.1.0
time: 1.7881393432617E-5 sectime: 2.288818359375E-5 sec
Output for 7.0.20
time: 2.5033950805664E-5 sectime: 2.0980834960938E-5 sec
Output for 7.0.19
time: 2.9087066650391E-5 sectime: 1.8835067749023E-5 sec
Output for 7.0.18
time: 1.8119812011719E-5 sectime: 1.5020370483398E-5 sec
Output for 7.0.17
time: 2.6941299438477E-5 sectime: 1.5020370483398E-5 sec
Output for 7.0.16
time: 2.5033950805664E-5 sectime: 1.0013580322266E-5 sec
Output for 7.0.15
time: 2.2172927856445E-5 sectime: 1.4066696166992E-5 sec
Output for 7.0.14
time: 2.288818359375E-5 sectime: 1.5020370483398E-5 sec
Output for 7.0.13
time: 2.4080276489258E-5 sectime: 1.5020370483398E-5 sec
Output for 7.0.12
time: 2.4080276489258E-5 sectime: 1.4066696166992E-5 sec
Output for 7.0.11
time: 2.0027160644531E-5 sectime: 1.4066696166992E-5 sec
Output for 7.0.10
time: 2.598762512207E-5 sectime: 1.5974044799805E-5 sec
Output for 7.0.9
time: 2.5033950805664E-5 sectime: 1.5020370483398E-5 sec
Output for 7.0.8
time: 2.288818359375E-5 sectime: 1.7881393432617E-5 sec
Output for 7.0.7
time: 2.3126602172852E-5 sectime: 1.5020370483398E-5 sec
Output for 7.0.6
time: 2.288818359375E-5 sectime: 1.5974044799805E-5 sec
Output for 7.0.4 - 7.0.5
time: 2.0980834960938E-5 sectime: 1.5020370483398E-5 sec
Output for 7.0.3
time: 1.3828277587891E-5 sectime: 1.5020370483398E-5 sec
Output for 7.0.2
time: 2.5033950805664E-5 sectime: 1.4066696166992E-5 sec
Output for 7.0.0
time: 2.1934509277344E-5 sectime: 1.5974044799805E-5 sec
Output for hhvm-3.15.4
time: 6.7949295043945E-5 sectime: 8.392333984375E-5 sec
Output for 5.6.30
time: 5.0067901611328E-5 sectime: 0.00023102760314941 sec
Output for 5.6.29
time: 5.3882598876953E-5 sectime: 0.00030088424682617 sec
Output for 5.6.28
time: 5.0067901611328E-5 sectime: 0.00026798248291016 sec
Output for 5.6.27
time: 8.9883804321289E-5 sectime: 0.00018000602722168 sec
Output for 5.6.26
time: 4.9114227294922E-5 sectime: 0.00025701522827148 sec
Output for 5.6.25
time: 5.1975250244141E-5 sectime: 0.00015997886657715 sec
Output for 5.6.24
time: 5.4121017456055E-5 sectime: 0.00018501281738281 sec
Output for 5.6.23
time: 5.0067901611328E-5 sectime: 0.00021600723266602 sec
Output for 5.6.22
time: 4.6014785766602E-5 sectime: 0.00027108192443848 sec
Output for 5.6.21
time: 5.5074691772461E-5 sectime: 0.00018095970153809 sec
Output for 5.6.20
time: 4.6014785766602E-5 sectime: 0.00022292137145996 sec
Output for 5.6.19
time: 4.6014785766602E-5 sectime: 0.00016093254089355 sec
Output for 5.6.18
time: 3.6001205444336E-5 sectime: 0.00016593933105469 sec
Output for 5.6.17
time: 5.4121017456055E-5 sectime: 0.00020694732666016 sec
Output for 5.6.16
time: 5.3882598876953E-5 sectime: 0.00022196769714355 sec
Output for 5.6.15
time: 5.1021575927734E-5 sectime: 0.00018000602722168 sec
Output for 5.6.14
time: 5.6982040405273E-5 sectime: 0.00018692016601562 sec
Output for 5.6.13
time: 5.6982040405273E-5 sectime: 0.00018501281738281 sec
Output for 5.6.12
time: 5.3882598876953E-5 sectime: 0.00026202201843262 sec
Output for 5.6.11
time: 5.0067901611328E-5 sectime: 0.00023198127746582 sec
Output for 5.6.10
time: 5.8889389038086E-5 sectime: 0.00027894973754883 sec
Output for 5.6.9
time: 5.5074691772461E-5 sectime: 0.0001990795135498 sec
Output for 5.6.8
time: 4.887580871582E-5 sectime: 0.00025486946105957 sec
Output for 5.6.7
time: 5.3882598876953E-5 sectime: 0.0002901554107666 sec
Output for 5.6.6
time: 3.6001205444336E-5 sectime: 0.00017905235290527 sec
Output for 5.6.5
time: 3.6001205444336E-5 sectime: 0.00022006034851074 sec
Output for 5.6.4
time: 4.0054321289062E-5 sectime: 0.0002589225769043 sec
Output for 5.6.3
time: 3.6954879760742E-5 sectime: 0.00022792816162109 sec
Output for 5.6.2
time: 4.9114227294922E-5 sectime: 0.0024371147155762 sec
Output for 5.6.1
time: 3.4809112548828E-5 sectime: 0.0001528263092041 sec
Output for 5.6.0
time: 3.6001205444336E-5 sectime: 0.00015711784362793 sec