3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = "turn on 0,0 through 999,999"; $lights = [[]]; for($i = 0; $i<1000; $i++){ for($j = 0; $j<1000; $j++){ $lights[$i][$j] = 0; } } explode("\n",$input); function action($s){ $on = preg_match("/turn on/",$s); $off = preg_match("/turn off/",$s); $toggle = preg_match("/toggle/",$s); if($on > 0){ return 1; } else if($off>0){ return 2; } else if($toggle>0){ return 3; } } echo action($input); ?>

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.40.0270.02734.55
8.3.30.0230.03634.76
8.3.20.0040.02535.96
8.3.10.0130.01339.82
8.3.00.0070.01737.39
8.2.170.0270.04734.84
8.2.160.0240.02836.19
8.2.150.0070.02135.33
8.2.140.0110.01438.43
8.2.130.0090.01937.04
8.2.120.0030.01939.86
8.2.110.0100.02638.90
8.2.100.0070.02639.76
8.2.90.0100.02434.96
8.2.80.0070.02633.50
8.2.70.0130.02033.50
8.2.60.0100.02433.68
8.2.50.0170.02433.50
8.2.40.0160.01636.04
8.2.30.0070.02436.25
8.2.20.0140.01733.66
8.2.10.0090.02234.05
8.2.00.0100.02333.82
8.1.270.0220.01346.78
8.1.260.0260.00848.46
8.1.250.0270.00746.68
8.1.240.0270.02345.07
8.1.230.0310.01643.77
8.1.220.0200.01343.39
8.1.210.0160.01643.23
8.1.200.0070.03443.11
8.1.190.0130.02342.97
8.1.180.0070.02643.28
8.1.170.0130.02244.39
8.1.160.0030.02748.35
8.1.150.0180.01444.51
8.1.140.0100.02345.25
8.1.130.0160.01643.42
8.1.120.0120.01943.11
8.1.110.0100.02143.26
8.1.100.0110.02143.27
8.1.90.0040.03643.15
8.1.80.0130.02043.16
8.1.70.0070.02443.06
8.1.60.0100.02643.41
8.1.50.0140.02443.31
8.1.40.0120.02543.30
8.1.30.0030.03843.38
8.1.20.0100.02943.26
8.1.10.0150.02949.07
8.1.00.0070.03548.91
8.0.300.0160.02048.29
8.0.290.0170.02148.25
8.0.280.0070.03149.78
8.0.270.0110.02548.55
8.0.260.0200.01748.55
8.0.250.0170.02048.14
8.0.240.0170.02048.26
8.0.230.0130.02648.18
8.0.220.0190.01948.12
8.0.210.0130.02348.04
8.0.200.0130.02348.16
8.0.190.0210.02848.16
8.0.180.0140.02848.10
8.0.170.0160.02648.03
8.0.160.0030.03948.00
8.0.150.0130.03348.10
8.0.140.0290.01348.03
8.0.130.0200.02744.58
8.0.120.0170.02748.15
8.0.110.0000.04348.35
8.0.100.0170.02448.07
8.0.90.0160.02648.27
8.0.80.0350.03548.08
8.0.70.0170.02448.06
8.0.60.0130.02947.88
8.0.50.0030.03747.93
8.0.30.0380.03948.37
8.0.20.0440.04848.23
8.0.10.0170.02348.14
8.0.00.0390.06148.27
7.4.330.0170.01350.00
7.4.320.0100.02647.97
7.4.300.0210.01847.91
7.4.290.0130.03448.06
7.4.280.0070.03947.91
7.4.270.0230.02048.10
7.4.260.0040.03948.04
7.4.250.0220.02247.92
7.4.240.0130.03048.00
7.4.230.0170.02748.14
7.4.220.0400.04048.12
7.4.210.0270.05448.00
7.4.200.0100.03348.15
7.4.160.0500.03647.93
7.4.150.0450.05248.05
7.4.140.0440.06347.92
7.4.130.0390.05148.08
7.4.120.0420.06747.73
7.4.110.0360.05648.03
7.4.100.0460.05347.50
7.4.90.0320.06347.92
7.4.80.0250.07647.90
7.4.70.0440.05447.87
7.4.60.0170.07447.71
7.4.50.0200.03747.81
7.4.40.0510.07847.66
7.4.30.0300.06847.99
7.4.00.0210.03146.07
7.3.330.0270.02044.64
7.3.320.0130.03344.63
7.3.310.0100.03947.41
7.3.300.0200.02747.38
7.3.290.0330.04947.54
7.3.280.0400.04947.62
7.3.270.0260.06347.84
7.3.260.0360.05947.86
7.3.250.0460.07647.61
7.3.240.0460.07047.81
7.3.230.0510.06847.49
7.3.210.0330.06447.56
7.3.200.0300.06747.63
7.3.190.0640.06247.80
7.3.180.0410.05447.73
7.3.170.0350.07747.60
7.3.160.0280.09147.59
7.3.120.0140.04445.88
7.3.110.0240.03445.97
7.3.100.0240.03046.36
7.3.90.0030.05045.90
7.3.80.0200.03446.11
7.3.70.0100.04945.95
7.3.60.0300.02746.18
7.3.50.0190.03845.96
7.3.40.0230.03346.00
7.3.30.0170.04145.70
7.3.20.0160.03252.41
7.3.10.0370.03952.64
7.3.00.0240.04352.57
7.2.330.0650.06647.75
7.2.320.0730.02948.04
7.2.310.0280.07248.08
7.2.300.0340.10247.91
7.2.290.0350.07147.98
7.2.240.0130.04146.44
7.2.230.0190.03946.36
7.2.220.0200.03746.32
7.2.210.0200.03946.23
7.2.200.0210.03846.34
7.2.190.0170.04546.53
7.2.180.0160.04246.18
7.2.170.0160.04546.12
7.2.160.0170.04246.41
7.2.150.0100.03552.91
7.2.140.0330.01352.74
7.2.130.0440.03552.91
7.2.120.0340.03852.74
7.2.110.0650.03852.54
7.2.100.0360.03952.72
7.2.90.0380.03552.63
7.2.80.0360.04652.69
7.2.70.0330.04152.80
7.2.60.0800.02852.70
7.2.50.0310.04552.91
7.2.40.0410.04252.56
7.2.30.0280.05052.87
7.2.20.0310.03652.72
7.2.10.0390.03952.80
7.2.00.0290.03953.78
7.1.330.0030.07551.90
7.1.320.0030.07551.53
7.1.310.0070.07251.72
7.1.300.0070.07351.72
7.1.290.0130.06151.54
7.1.280.0070.06951.41
7.1.270.0170.05751.80
7.1.260.0200.08051.46
7.1.250.0180.07851.82
7.1.200.0390.03651.48
7.1.100.7740.03649.48
7.1.70.0100.02952.78
7.1.60.0070.05852.88
7.1.50.0200.05752.80
7.1.00.0070.12058.45
7.0.200.5760.04348.94
7.0.60.0200.10751.11
7.0.50.0200.12349.05
7.0.40.0130.12320.26
7.0.30.0270.07320.25
7.0.20.0270.11020.08
7.0.10.0030.12020.32
7.0.00.0230.09320.16
5.6.280.0130.12085.82
5.6.210.0200.19085.48
5.6.200.0430.10082.90
5.6.190.0330.14385.02
5.6.180.0300.11085.10
5.6.170.0570.14784.95
5.6.160.0130.15385.11
5.6.150.0270.13082.93
5.6.140.0170.10782.89
5.6.130.0230.17782.80
5.6.120.0530.13385.68
5.6.110.0330.09785.84
5.6.100.0600.13785.60
5.6.90.0270.15785.68
5.6.80.0430.15785.22
5.5.350.0300.16085.18
5.5.340.0300.13382.68
5.5.330.0230.11384.74
5.5.320.0800.10084.71
5.5.310.0330.10784.83
5.5.300.0400.12382.67
5.5.290.0230.15782.50
5.5.280.0300.16385.64
5.5.270.0300.16785.51
5.5.260.0230.16085.36
5.5.250.0330.17785.29
5.5.240.0300.15084.75

preferences:
37.72 ms | 400 KiB | 5 Q