3v4l.org

run code in 300+ PHP versions simultaneously
1. <?php 2. $cast = array("william shatner", "leonard nimoy", "deforest kelley"); 3. print count($cast) . "\n"; 4. print $cast[1] . "\n"; 5. $cast[] = "James Doohan"; 6. print count($cast) . "\n"; 7. print $cast[count($cast)-1] . "\n"; 8. $cast[2] = "George Takei"; 9. $i = 1; 10. foreach($cast as $actor){ 11. print ("$i) $actor\n"); 12. $i = $i + 1; 12. } 13. ?>

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.230.0100.05212.37
5.4.220.0090.05212.37
5.4.210.0120.04912.37
5.4.200.0090.05212.37
5.4.190.0130.04912.37
5.4.180.0130.04812.37
5.4.170.0150.04512.38
5.4.160.0120.04912.37
5.4.150.0100.05412.36
5.4.140.0130.04712.06
5.4.130.0140.04712.04
5.4.120.0130.05012.00
5.4.110.0090.05212.00
5.4.100.0120.04612.00
5.4.90.0100.04512.00
5.4.80.0150.03612.00
5.4.70.0130.03912.00
5.4.60.0110.03911.99
5.4.50.0120.03812.00
5.4.40.0130.03811.98
5.4.30.0110.04711.98
5.4.20.0120.04311.98
5.4.10.0130.03611.98
5.4.00.0090.03911.47
5.3.280.0110.04412.71
5.3.270.0140.04312.72
5.3.260.0150.04112.72
5.3.250.0150.03812.72
5.3.240.0110.04512.72
5.3.230.0140.04712.71
5.3.220.0180.05512.68
5.3.210.0110.04612.68
5.3.200.0140.05412.68
5.3.190.0140.04512.68
5.3.180.0160.04312.67
5.3.170.0160.03812.67
5.3.160.0140.04012.67
5.3.150.0150.04112.68
5.3.140.0130.04712.66
5.3.130.0130.04212.66
5.3.120.0090.04712.66
5.3.110.0150.04012.65
5.3.100.0090.04512.12
5.3.90.0120.04312.08
5.3.80.0110.04212.07
5.3.70.0100.04212.07
5.3.60.0120.03912.07
5.3.50.0120.04112.00
5.3.40.0110.04312.00
5.3.30.0120.04511.94
5.3.20.0120.04111.71
5.3.10.0090.04211.68
5.3.00.0110.04211.66

preferences:
141.38 ms | 1394 KiB | 7 Q