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/"); $off = preg_match("/turn off/"); $toggle = preg_match("/toggle/"); 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.60.0420.03632.38
8.3.50.0350.03333.25
8.3.40.0140.03734.59
8.3.30.0290.02634.47
8.3.20.0140.01435.82
8.3.10.0180.01138.14
8.3.00.0160.01634.29
8.2.180.0340.03732.50
8.2.170.0270.02434.57
8.2.160.0130.04036.27
8.2.150.0140.01434.51
8.2.140.0130.01337.91
8.2.130.0130.01635.05
8.2.120.0110.01139.55
8.2.110.0160.02636.10
8.2.100.0200.02333.47
8.2.90.0130.02933.63
8.2.80.0130.02033.68
8.2.70.0210.01133.80
8.2.60.0000.03133.68
8.2.50.0130.01933.13
8.2.40.0030.02736.17
8.2.30.0160.01636.32
8.2.20.0070.02733.21
8.2.10.0000.03533.73
8.2.00.0070.02733.71
8.1.280.0290.03947.78
8.1.270.0310.01445.96
8.1.260.0230.01048.02
8.1.250.0240.01446.02
8.1.240.0140.01751.65
8.1.230.0260.01944.95
8.1.220.0100.02343.66
8.1.210.0140.02143.11
8.1.200.0130.02643.22
8.1.190.0070.02743.09
8.1.180.0070.02843.23
8.1.170.0130.02244.58
8.1.160.0170.01446.45
8.1.150.0070.02944.53
8.1.140.0100.02345.26
8.1.130.0040.03243.34
8.1.120.0150.01543.26
8.1.110.0140.02143.14
8.1.100.0300.00743.21
8.1.90.0130.02943.16
8.1.80.0100.02443.23
8.1.70.0140.01743.06
8.1.60.0100.02643.42
8.1.50.0170.02043.26
8.1.40.0160.02343.27
8.1.30.0190.02243.38
8.1.20.0210.02143.35
8.1.10.0130.02848.79
8.1.00.0030.03948.76
8.0.300.0130.02551.16
8.0.290.0100.02947.75
8.0.280.0210.01449.79
8.0.270.0130.02348.55
8.0.260.0140.02448.55
8.0.250.0100.02548.14
8.0.240.0190.02248.04
8.0.230.0160.02647.95
8.0.220.0170.02448.01
8.0.210.0100.02448.04
8.0.200.0170.02448.02
8.0.190.0370.01748.11
8.0.180.0040.03948.04
8.0.170.0170.02747.88
8.0.160.0140.03248.06
8.0.150.0160.02547.93
8.0.140.0070.03847.93
8.0.130.0200.03344.50
8.0.120.0160.02847.98
8.0.110.0130.02747.86
8.0.100.0170.02447.80
8.0.90.0240.01747.98
8.0.80.0360.04247.95
8.0.70.0230.02047.89
8.0.60.0180.02247.97
8.0.50.0130.02647.81
8.0.30.0390.03848.12
8.0.20.0430.05348.39
8.0.10.0170.02448.10
8.0.00.0470.04647.72
7.4.330.0170.02147.50
7.4.320.0160.02047.46
7.4.300.0130.03047.70
7.4.290.0170.02747.68
7.4.280.0270.03747.57
7.4.270.0190.03347.68
7.4.260.0110.03247.66
7.4.250.0130.03347.63
7.4.240.0100.03347.55
7.4.230.0070.03747.54
7.4.220.0260.05647.75
7.4.210.0370.04047.68
7.4.200.0070.03547.76
7.4.160.0520.03347.57
7.4.150.0430.04747.57
7.4.140.0510.07347.66
7.4.130.0300.06647.67
7.4.120.0460.04747.53
7.4.110.0230.07147.62
7.4.100.0490.04847.66
7.4.90.0430.05347.49
7.4.80.0520.05247.62
7.4.70.0430.05347.63
7.4.60.0520.03947.65
7.4.50.0170.04047.65
7.4.40.0390.06947.79
7.4.30.0420.07547.40
7.4.00.0210.03845.89
7.3.330.0160.03244.65
7.3.320.0160.03344.64
7.3.310.0140.03447.36
7.3.300.0070.03947.55
7.3.290.0430.05047.49
7.3.280.0400.05647.48
7.3.270.0400.05047.69
7.3.260.0390.06247.91
7.3.250.0430.06447.56
7.3.240.0420.06247.63
7.3.230.0250.07547.56
7.3.210.0440.05447.47
7.3.200.0520.06247.59
7.3.190.0460.05747.57
7.3.180.0430.04947.64
7.3.170.0590.08247.57
7.3.160.0590.06947.86
7.2.330.0250.07947.93
7.2.320.0360.08248.04
7.2.310.0360.06847.87
7.2.300.0480.07147.91
7.2.290.0540.08147.72
7.2.110.5980.03952.22
7.2.60.1060.03052.57
7.2.00.0270.03755.35
7.1.200.0270.04051.66
7.1.100.0770.02029.95
7.1.70.0070.05752.78
7.1.60.0100.04553.20
7.1.50.0160.06352.96
7.1.00.0030.12058.41
7.0.200.6710.04049.06
7.0.60.0330.11051.04
7.0.50.0230.06749.04
7.0.40.0130.07020.18
7.0.30.0300.11320.08
7.0.20.0400.09720.07
7.0.10.0130.08720.07
7.0.00.0070.07720.22
5.6.280.0230.11385.81
5.6.210.0400.10385.38
5.6.200.0300.16382.87
5.6.190.0330.16785.17
5.6.180.0400.10385.02
5.6.170.0400.14785.04
5.6.160.0230.16785.11
5.6.150.0270.09782.80
5.6.140.0400.13082.84
5.6.130.0230.16382.89
5.6.120.0570.12085.72
5.6.110.0230.13785.66
5.6.100.0430.09385.75
5.6.90.0270.16085.59
5.6.80.0600.14785.05
5.5.350.0170.11385.11
5.5.340.0430.15082.61
5.5.330.0370.13084.86
5.5.320.1000.13384.93
5.5.310.0330.13084.96
5.5.300.0370.16082.60
5.5.290.0230.16382.65
5.5.280.0230.15085.37
5.5.270.0330.17385.48
5.5.260.0300.14785.48
5.5.250.0330.13085.31
5.5.240.0500.09084.90

preferences:
38.69 ms | 401 KiB | 5 Q