3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foods = array( 'meat' => array('burgers', 'steak', 'sausages', 'kebabs'), 'cake' => array('victorian', 'chocolate', 'fruit', 'fudge'), ); function getMeat(array $foods) { if (!isset($foods['meat']) { throw new Exception('There is no meat in this pie'); } $meatCount = count($foods['meats']); if($meatCount < 1) { throw new Exception('Where did all the meat go!?'); } var_dump($foods); $i = 0; $j = 1; while($i < $meatCount) { if ($foods['meats'][$i] < $foods['meats'][$j]) { $tempMeat = $foods['meats'][$i]; $foods['meats'][$i] = $foods['meats'][$j]; $foods['meats'][$j] = $tempMeat; } $i++; $j++; } var_dump($foods); }

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)
5.4.190.0090.05112.40
5.4.180.0150.04212.40
5.4.170.0150.04212.41
5.4.160.0140.04612.39
5.4.150.0190.04112.39
5.4.140.0150.04412.08
5.4.130.0140.04412.07
5.4.120.0240.06312.03
5.4.110.0150.04112.03
5.4.100.0130.04612.03
5.4.90.0170.04412.03
5.4.80.0180.04112.02
5.4.70.0130.04312.02
5.4.60.0170.04012.02
5.4.50.0270.06112.02
5.4.40.0150.04212.01
5.4.30.0300.05912.01
5.4.20.0140.04212.00
5.4.10.0120.04412.01
5.4.00.0120.04311.50
5.3.270.0170.04312.72
5.3.260.0140.04612.72
5.3.250.0160.04312.72
5.3.240.0300.09012.72
5.3.230.0170.04412.71
5.3.220.0190.04012.68
5.3.210.0110.04912.68
5.3.200.0110.04812.68
5.3.190.0200.04112.68
5.3.180.0140.04512.68
5.3.170.0180.04512.67
5.3.160.0240.06512.68
5.3.150.0120.04812.67
5.3.140.0110.04712.66
5.3.130.0150.04512.66
5.3.120.0220.03812.66
5.3.110.0180.04212.66
5.3.100.0130.04812.12
5.3.90.0170.04112.09
5.3.80.0160.04412.09
5.3.70.0200.04112.09
5.3.60.0270.06512.07
5.3.50.0140.04512.02
5.3.40.0170.04212.02
5.3.30.0230.03912.00
5.3.20.0280.09011.77
5.3.10.0110.04411.72
5.3.00.0240.03311.71

preferences:
144.26 ms | 1394 KiB | 7 Q