3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Collection { private $a = array(); public function __construct() { for ($i = 0; $i < 100000; $i++) { $this->a[] = $i; } } public function all() { return $this->a; } } $coll = new Collection(); $start = microtime(true); foreach ($coll->all() as $k => $v) { $a[$k] = $v + 1; } echo "Completed in ", microtime(true) - $start, " Seconds\n"; $start = microtime(true); $arr = $coll->all(); foreach ($arr as $k => &$v) { $v = $v + 1; } echo "Completed in ", microtime(true) - $start, " Seconds\n";
Output for 7.1.0
Completed in 0.0049018859863281 Seconds Completed in 0.0073890686035156 Seconds
Output for 7.0.14
Completed in 0.0051648616790771 Seconds Completed in 0.0068390369415283 Seconds
Output for 7.0.11
Completed in 0.11429595947266 Seconds Completed in 0.11482381820679 Seconds
Output for 7.0.10
Completed in 0.10527896881104 Seconds Completed in 0.1052839756012 Seconds
Output for 7.0.9
Completed in 0.11285209655762 Seconds Completed in 0.060555934906006 Seconds
Output for 7.0.8
Completed in 0.0064139366149902 Seconds Completed in 0.0067358016967773 Seconds
Output for 7.0.7
Completed in 0.11235380172729 Seconds Completed in 0.11262202262878 Seconds
Output for 7.0.6
Completed in 0.11292791366577 Seconds Completed in 0.099788188934326 Seconds
Output for 7.0.5
Completed in 0.099801063537598 Seconds Completed in 0.11279511451721 Seconds
Output for 7.0.4
Completed in 0.11278986930847 Seconds Completed in 0.076694011688232 Seconds
Output for 7.0.3
Completed in 0.11257791519165 Seconds Completed in 0.065083026885986 Seconds
Output for 7.0.2
Completed in 0.11427998542786 Seconds Completed in 0.077320098876953 Seconds
Output for 7.0.1
Completed in 0.11254596710205 Seconds Completed in 0.076793909072876 Seconds
Output for 7.0.0
Completed in 0.12553000450134 Seconds Completed in 0.084224939346313 Seconds
Output for hhvm-3.13.2
Completed in 0.020528078079224 Seconds Completed in 0.015696048736572 Seconds
Output for hhvm-3.12.0
Completed in 0.011713981628418 Seconds Completed in 0.011343002319336 Seconds
Output for hhvm-3.10.0
Completed in 0.014081954956055 Seconds Completed in 0.011729001998901 Seconds
Output for 5.6.28
Completed in 0.022240161895752 Seconds Completed in 0.018547058105469 Seconds
Output for 5.6.26
Completed in 0.017154932022095 Seconds Completed in 0.014687061309814 Seconds
Output for 5.6.25
Completed in 0.017266035079956 Seconds Completed in 0.0139000415802 Seconds
Output for 5.6.24
Completed in 0.022166013717651 Seconds Completed in 0.018814086914062 Seconds
Output for 5.6.23
Completed in 0.017582178115845 Seconds Completed in 0.015069961547852 Seconds
Output for 5.6.22
Completed in 0.022087097167969 Seconds Completed in 0.016021013259888 Seconds
Output for 5.6.21
Completed in 0.018079996109009 Seconds Completed in 0.016094923019409 Seconds
Output for 5.6.20
Completed in 0.01878809928894 Seconds Completed in 0.016427040100098 Seconds
Output for 5.6.19
Completed in 0.018676996231079 Seconds Completed in 0.01587986946106 Seconds
Output for 5.6.18
Completed in 0.023041009902954 Seconds Completed in 0.019351005554199 Seconds
Output for 5.6.17
Completed in 0.023831844329834 Seconds Completed in 0.019081115722656 Seconds
Output for 5.6.16
Completed in 0.025235176086426 Seconds Completed in 0.019747972488403 Seconds
Output for 5.6.15
Completed in 0.021198034286499 Seconds Completed in 0.01860499382019 Seconds
Output for 5.6.14
Completed in 0.01867413520813 Seconds Completed in 0.014770984649658 Seconds
Output for 5.6.13
Completed in 0.021086931228638 Seconds Completed in 0.017743110656738 Seconds
Output for 5.6.12
Completed in 0.019673109054565 Seconds Completed in 0.016694068908691 Seconds
Output for 5.6.11
Completed in 0.020948171615601 Seconds Completed in 0.017855882644653 Seconds
Output for 5.6.10
Completed in 0.018163919448853 Seconds Completed in 0.014621019363403 Seconds
Output for 5.6.9
Completed in 0.02208399772644 Seconds Completed in 0.017832040786743 Seconds
Output for 5.6.8
Completed in 0.016278028488159 Seconds Completed in 0.014338970184326 Seconds
Output for 5.6.7
Completed in 0.019688129425049 Seconds Completed in 0.018335103988647 Seconds
Output for 5.6.6
Completed in 0.019829988479614 Seconds Completed in 0.017184019088745 Seconds
Output for 5.6.5
Completed in 0.020912885665894 Seconds Completed in 0.018134832382202 Seconds
Output for 5.6.4
Completed in 0.018255949020386 Seconds Completed in 0.014835119247437 Seconds
Output for 5.6.3
Completed in 0.022408962249756 Seconds Completed in 0.019464015960693 Seconds
Output for 5.6.2
Completed in 0.019366979598999 Seconds Completed in 0.015902042388916 Seconds
Output for 5.6.1
Completed in 0.022525072097778 Seconds Completed in 0.019626140594482 Seconds
Output for 5.6.0
Completed in 0.020265102386475 Seconds Completed in 0.018234014511108 Seconds
Output for 5.5.38
Completed in 0.020506858825684 Seconds Completed in 0.016654014587402 Seconds
Output for 5.5.37
Completed in 0.022461891174316 Seconds Completed in 0.016970872879028 Seconds
Output for 5.5.36
Completed in 0.020630121231079 Seconds Completed in 0.016161918640137 Seconds
Output for 5.5.35
Completed in 0.017701864242554 Seconds Completed in 0.01567006111145 Seconds
Output for 5.5.34
Completed in 0.022109031677246 Seconds Completed in 0.019361972808838 Seconds
Output for 5.5.33
Completed in 0.019934177398682 Seconds Completed in 0.017552852630615 Seconds
Output for 5.5.32
Completed in 0.016487121582031 Seconds Completed in 0.01467490196228 Seconds
Output for 5.5.31
Completed in 0.018206834793091 Seconds Completed in 0.015718936920166 Seconds
Output for 5.5.30
Completed in 0.022233009338379 Seconds Completed in 0.019237041473389 Seconds
Output for 5.5.29
Completed in 0.01915717124939 Seconds Completed in 0.015022993087769 Seconds
Output for 5.5.28
Completed in 0.017059087753296 Seconds Completed in 0.015197992324829 Seconds
Output for 5.5.27
Completed in 0.017790079116821 Seconds Completed in 0.015827894210815 Seconds
Output for 5.5.26
Completed in 0.018321990966797 Seconds Completed in 0.015459060668945 Seconds
Output for 5.5.25
Completed in 0.019808053970337 Seconds Completed in 0.0157630443573 Seconds
Output for 5.5.24
Completed in 0.022135972976685 Seconds Completed in 0.018800973892212 Seconds
Output for 5.5.23
Completed in 0.020216941833496 Seconds Completed in 0.017628908157349 Seconds
Output for 5.5.22
Completed in 0.019806861877441 Seconds Completed in 0.016134977340698 Seconds
Output for 5.5.21
Completed in 0.018687009811401 Seconds Completed in 0.015310049057007 Seconds
Output for 5.5.20
Completed in 0.019809007644653 Seconds Completed in 0.017512083053589 Seconds
Output for 5.5.19
Completed in 0.019954919815063 Seconds Completed in 0.016674041748047 Seconds
Output for 5.5.18
Completed in 0.018512964248657 Seconds Completed in 0.015902996063232 Seconds
Output for 5.5.16
Completed in 0.017408132553101 Seconds Completed in 0.015726089477539 Seconds
Output for 5.5.15
Completed in 0.016216039657593 Seconds Completed in 0.014070987701416 Seconds
Output for 5.5.14
Completed in 0.01963210105896 Seconds Completed in 0.016774892807007 Seconds
Output for 5.5.13
Completed in 0.021000146865845 Seconds Completed in 0.016134977340698 Seconds
Output for 5.5.12
Completed in 0.01923394203186 Seconds Completed in 0.01668381690979 Seconds
Output for 5.5.11
Completed in 0.019062995910645 Seconds Completed in 0.016478061676025 Seconds
Output for 5.5.10
Completed in 0.020040035247803 Seconds Completed in 0.016533136367798 Seconds
Output for 5.5.9
Completed in 0.022291898727417 Seconds Completed in 0.018512010574341 Seconds
Output for 5.5.8
Completed in 0.01848292350769 Seconds Completed in 0.015934944152832 Seconds
Output for 5.5.7
Completed in 0.016989946365356 Seconds Completed in 0.014672994613647 Seconds
Output for 5.5.6
Completed in 0.018678188323975 Seconds Completed in 0.015060901641846 Seconds
Output for 5.5.5
Completed in 0.016836881637573 Seconds Completed in 0.013761043548584 Seconds
Output for 5.5.4
Completed in 0.019912958145142 Seconds Completed in 0.016998052597046 Seconds
Output for 5.5.3
Completed in 0.015341997146606 Seconds Completed in 0.013690948486328 Seconds
Output for 5.5.2
Completed in 0.015278100967407 Seconds Completed in 0.013643026351929 Seconds
Output for 5.5.1
Completed in 0.014770984649658 Seconds Completed in 0.013083219528198 Seconds
Output for 5.5.0
Completed in 0.016138076782227 Seconds Completed in 0.014416933059692 Seconds
Output for 5.4.45
Completed in 0.018320083618164 Seconds Completed in 0.016166925430298 Seconds
Output for 5.4.44
Completed in 0.019436120986938 Seconds Completed in 0.01711106300354 Seconds
Output for 5.4.43
Completed in 0.019265174865723 Seconds Completed in 0.01716685295105 Seconds
Output for 5.4.42
Completed in 0.023015022277832 Seconds Completed in 0.019193172454834 Seconds
Output for 5.4.41
Completed in 0.016527891159058 Seconds Completed in 0.015028953552246 Seconds
Output for 5.4.40
Completed in 0.023022890090942 Seconds Completed in 0.019486904144287 Seconds
Output for 5.4.39
Completed in 0.021373987197876 Seconds Completed in 0.018527030944824 Seconds
Output for 5.4.38
Completed in 0.017498970031738 Seconds Completed in 0.015414953231812 Seconds
Output for 5.4.37
Completed in 0.020357131958008 Seconds Completed in 0.016183137893677 Seconds
Output for 5.4.36
Completed in 0.018105030059814 Seconds Completed in 0.015775918960571 Seconds
Output for 5.4.35
Completed in 0.01817512512207 Seconds Completed in 0.015370845794678 Seconds
Output for 5.4.34
Completed in 0.016366004943848 Seconds Completed in 0.014586925506592 Seconds
Output for 5.4.32
Completed in 0.017677068710327 Seconds Completed in 0.015344858169556 Seconds
Output for 5.4.31
Completed in 0.022601127624512 Seconds Completed in 0.017085075378418 Seconds
Output for 5.4.30
Completed in 0.021495819091797 Seconds Completed in 0.018357992172241 Seconds
Output for 5.4.29
Completed in 0.019128084182739 Seconds Completed in 0.015978097915649 Seconds
Output for 5.4.28
Completed in 0.019560813903809 Seconds Completed in 0.014937877655029 Seconds
Output for 5.4.27
Completed in 0.020581960678101 Seconds Completed in 0.01530909538269 Seconds
Output for 5.4.26
Completed in 0.017319917678833 Seconds Completed in 0.014675140380859 Seconds
Output for 5.4.25
Completed in 0.017497062683105 Seconds Completed in 0.015054941177368 Seconds
Output for 5.4.24
Completed in 0.016051054000854 Seconds Completed in 0.014512062072754 Seconds
Output for 5.4.23
Completed in 0.017279863357544 Seconds Completed in 0.014317989349365 Seconds
Output for 5.4.22
Completed in 0.017616987228394 Seconds Completed in 0.015240907669067 Seconds
Output for 5.4.21
Completed in 0.015285968780518 Seconds Completed in 0.013849973678589 Seconds
Output for 5.4.20
Completed in 0.0153968334198 Seconds Completed in 0.01400899887085 Seconds
Output for 5.4.19
Completed in 0.015288114547729 Seconds Completed in 0.013883829116821 Seconds
Output for 5.4.18
Completed in 0.016677856445312 Seconds Completed in 0.014124155044556 Seconds
Output for 5.4.17
Completed in 0.019579887390137 Seconds Completed in 0.015412092208862 Seconds
Output for 5.4.16
Completed in 0.016175985336304 Seconds Completed in 0.013624906539917 Seconds
Output for 5.4.15
Completed in 0.016235113143921 Seconds Completed in 0.01470422744751 Seconds
Output for 5.4.14
Completed in 0.014832019805908 Seconds Completed in 0.013104915618896 Seconds
Output for 5.4.13
Completed in 0.014822959899902 Seconds Completed in 0.013227224349976 Seconds
Output for 5.4.12
Completed in 0.017221927642822 Seconds Completed in 0.016120910644531 Seconds
Output for 5.4.11
Completed in 0.021640777587891 Seconds Completed in 0.017927169799805 Seconds
Output for 5.4.10
Completed in 0.014898061752319 Seconds Completed in 0.013208150863647 Seconds
Output for 5.4.9
Completed in 0.014677047729492 Seconds Completed in 0.013604164123535 Seconds
Output for 5.4.8
Completed in 0.014572858810425 Seconds Completed in 0.013136863708496 Seconds
Output for 5.4.7
Completed in 0.014590978622437 Seconds Completed in 0.013425827026367 Seconds
Output for 5.4.6
Completed in 0.014536142349243 Seconds Completed in 0.013343811035156 Seconds
Output for 5.4.5
Completed in 0.016685962677002 Seconds Completed in 0.014425039291382 Seconds
Output for 5.4.4
Completed in 0.018174886703491 Seconds Completed in 0.014019966125488 Seconds
Output for 5.4.3
Completed in 0.018970966339111 Seconds Completed in 0.015777111053467 Seconds
Output for 5.4.2
Completed in 0.022485017776489 Seconds Completed in 0.016358137130737 Seconds
Output for 5.4.1
Completed in 0.021912097930908 Seconds Completed in 0.016349792480469 Seconds
Output for 5.4.0
Completed in 0.020569086074829 Seconds Completed in 0.017699003219604 Seconds
Output for 5.3.29
Completed in 0.018244028091431 Seconds Completed in 0.015979051589966 Seconds
Output for 5.3.28
Completed in 0.022418022155762 Seconds Completed in 0.016962051391602 Seconds
Output for 5.3.27
Completed in 0.02128791809082 Seconds Completed in 0.015997171401978 Seconds
Output for 5.3.26
Completed in 0.021270036697388 Seconds Completed in 0.018182992935181 Seconds
Output for 5.3.25
Completed in 0.018826961517334 Seconds Completed in 0.01636815071106 Seconds
Output for 5.3.24
Completed in 0.018097877502441 Seconds Completed in 0.015097856521606 Seconds
Output for 5.3.23
Completed in 0.016072034835815 Seconds Completed in 0.01436185836792 Seconds
Output for 5.3.22
Completed in 0.016223907470703 Seconds Completed in 0.01419997215271 Seconds
Output for 5.3.21
Completed in 0.015918016433716 Seconds Completed in 0.01485800743103 Seconds
Output for 5.3.20
Completed in 0.018046855926514 Seconds Completed in 0.015175104141235 Seconds
Output for 5.3.19
Completed in 0.017052173614502 Seconds Completed in 0.015053987503052 Seconds
Output for 5.3.18
Completed in 0.01698899269104 Seconds Completed in 0.014988899230957 Seconds
Output for 5.3.17
Completed in 0.022271156311035 Seconds Completed in 0.018655061721802 Seconds
Output for 5.3.16
Completed in 0.017251968383789 Seconds Completed in 0.014907121658325 Seconds
Output for 5.3.15
Completed in 0.018622159957886 Seconds Completed in 0.016726016998291 Seconds
Output for 5.3.14
Completed in 0.017995834350586 Seconds Completed in 0.015737056732178 Seconds
Output for 5.3.13
Completed in 0.017749071121216 Seconds Completed in 0.015624046325684 Seconds
Output for 5.3.12
Completed in 0.022014856338501 Seconds Completed in 0.016427040100098 Seconds
Output for 5.3.11
Completed in 0.022654056549072 Seconds Completed in 0.018756866455078 Seconds
Output for 5.3.10
Completed in 0.01957106590271 Seconds Completed in 0.016368865966797 Seconds
Output for 5.3.9
Completed in 0.020848989486694 Seconds Completed in 0.017119169235229 Seconds
Output for 5.3.8
Completed in 0.02312707901001 Seconds Completed in 0.01584005355835 Seconds
Output for 5.3.7
Completed in 0.020953893661499 Seconds Completed in 0.017887115478516 Seconds
Output for 5.3.6
Completed in 0.021522045135498 Seconds Completed in 0.017328977584839 Seconds
Output for 5.3.5
Completed in 0.023334980010986 Seconds Completed in 0.016796827316284 Seconds
Output for 5.3.4
Completed in 0.020150899887085 Seconds Completed in 0.016714096069336 Seconds
Output for 5.3.3
Completed in 0.023068904876709 Seconds Completed in 0.019556045532227 Seconds
Output for 5.3.2
Completed in 0.020714044570923 Seconds Completed in 0.017435073852539 Seconds
Output for 5.3.1
Completed in 0.023685932159424 Seconds Completed in 0.01649808883667 Seconds
Output for 5.3.0
Completed in 0.021001100540161 Seconds Completed in 0.017716884613037 Seconds
Output for 5.2.17
Completed in 0.027549028396606 Seconds Completed in 0.020774841308594 Seconds
Output for 5.2.16
Completed in 0.020326137542725 Seconds Completed in 0.017091035842896 Seconds
Output for 5.2.15
Completed in 0.028185129165649 Seconds Completed in 0.019378900527954 Seconds
Output for 5.2.14
Completed in 0.022794961929321 Seconds Completed in 0.017611026763916 Seconds
Output for 5.2.13
Completed in 0.028838157653809 Seconds Completed in 0.018476009368896 Seconds
Output for 5.2.12
Completed in 0.02814793586731 Seconds Completed in 0.022073030471802 Seconds
Output for 5.2.11
Completed in 0.0262291431427 Seconds Completed in 0.020183086395264 Seconds
Output for 5.2.10
Completed in 0.022842884063721 Seconds Completed in 0.018457889556885 Seconds
Output for 5.2.9
Completed in 0.023843050003052 Seconds Completed in 0.018868923187256 Seconds
Output for 5.2.8
Completed in 0.025099039077759 Seconds Completed in 0.019439935684204 Seconds
Output for 5.2.7
Completed in 0.02412486076355 Seconds Completed in 0.017913818359375 Seconds
Output for 5.2.6
Completed in 0.026400089263916 Seconds Completed in 0.017162799835205 Seconds
Output for 5.2.5
Completed in 0.03256893157959 Seconds Completed in 0.025144100189209 Seconds
Output for 5.2.4
Completed in 0.03374195098877 Seconds Completed in 0.026081085205078 Seconds
Output for 5.2.3
Completed in 0.024598836898804 Seconds Completed in 0.019765853881836 Seconds
Output for 5.2.2
Completed in 0.026250123977661 Seconds Completed in 0.019841909408569 Seconds
Output for 5.2.1
Completed in 0.030546188354492 Seconds Completed in 0.025027990341187 Seconds
Output for 5.2.0
Completed in 0.025385856628418 Seconds Completed in 0.015779972076416 Seconds
Output for 5.1.6
Completed in 0.033761978149414 Seconds Completed in 0.027040004730225 Seconds
Output for 5.1.5
Completed in 0.027509212493896 Seconds Completed in 0.021005153656006 Seconds
Output for 5.1.4
Completed in 0.024237871170044 Seconds Completed in 0.021249055862427 Seconds
Output for 5.1.3
Completed in 0.027531147003174 Seconds Completed in 0.022748947143555 Seconds
Output for 5.1.2
Completed in 0.029155015945435 Seconds Completed in 0.022209167480469 Seconds
Output for 5.1.1
Completed in 0.029038190841675 Seconds Completed in 0.022387981414795 Seconds
Output for 5.1.0
Completed in 0.028388977050781 Seconds Completed in 0.021784782409668 Seconds
Output for 5.0.5
Completed in 0.06318998336792 Seconds Completed in 0.04794716835022 Seconds
Output for 5.0.4
Completed in 0.060824871063232 Seconds Completed in 0.047128915786743 Seconds
Output for 5.0.3
Completed in 0.061637878417969 Seconds Completed in 0.046067953109741 Seconds
Output for 5.0.2
Completed in 0.05390191078186 Seconds Completed in 0.042291164398193 Seconds
Output for 5.0.1
Completed in 0.063529968261719 Seconds Completed in 0.052725076675415 Seconds
Output for 5.0.0
Completed in 0.058681011199951 Seconds Completed in 0.045105934143066 Seconds
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/VZW6U on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/VZW6U on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/VZW6U on line 5
Process exited with code 255.