3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = ['one', 'two', 'three', 'four', 'five']; echo 'Current value: ' . current($arr) . "\n"; foreach ($arr as $a) { if ($a === 'three') break; } echo 'Did it change? ' . current($arr) . "\n"; function withRef(array &$arr): void { foreach ($arr as $a) { if ($a === 'three') break; } } withRef($arr); echo 'What about now? ' . current($arr) . "\n";

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.120.0000.00920.75
8.3.110.0040.00420.94
8.3.100.0050.00324.06
8.3.90.0050.00326.77
8.3.80.0060.00318.30
8.3.70.0140.00917.81
8.3.60.0060.00317.84
8.3.50.0120.00017.84
8.2.240.0030.00617.06
8.2.230.0100.00022.58
8.2.220.0110.00037.54
8.2.210.0080.00026.77
8.2.200.0030.00618.17
8.2.190.0060.00318.54
8.2.180.0090.00018.41
8.1.290.0030.00630.84
8.1.280.0060.00317.84
7.4.330.0140.00317.97
5.5.210.0130.00217.84

preferences:
16.21 ms | 403 KiB | 5 Q