3v4l.org

run code in 300+ PHP versions simultaneously
<?php $requiredFields = ['name', 'age', 'hair_colour']; // Note: $errorString is not initialised foreach ( $requiredFields as $field ) { if ( ! isset($_POST[$field]) ) { $errorString .= "Missing required field '$field'. "; } } echo $errorString;

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.0060.01216.75
8.3.50.0100.00718.62
8.3.40.0070.01320.30
8.3.30.0090.00619.33
8.3.20.0050.00324.18
8.3.10.0060.00324.66
8.3.00.0000.00726.16
8.2.180.0100.01025.92
8.2.170.0070.00718.91
8.2.160.0120.00622.96
8.2.150.0080.00025.66
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0050.00326.16
8.2.110.0030.00621.04
8.2.100.0070.00419.37
8.2.90.0030.00618.09
8.2.80.0000.00720.55
8.2.70.0060.00317.90
8.2.60.0060.00317.93
8.2.50.0040.00418.10
8.2.40.0000.00822.38
8.2.30.0000.00819.21
8.2.20.0030.00520.49
8.2.10.0000.00717.97
8.2.00.0040.00419.23
8.1.280.0070.00725.92
8.1.270.0040.00423.99
8.1.260.0000.00726.35
8.1.250.0050.00228.09
8.1.240.0040.00422.19
8.1.230.0090.00320.90
8.1.220.0060.00617.74
8.1.210.0040.00418.93
8.1.200.0030.00617.23
8.1.190.0040.00417.00
8.1.180.0050.00518.10
8.1.170.0000.00818.50
8.1.160.0050.00318.99
8.1.150.0000.01118.55
8.1.140.0070.00017.48
8.1.130.0030.00318.93
8.1.120.0070.00017.52
8.1.110.0040.00417.30
8.1.100.0040.00417.47
8.1.90.0040.00717.44
8.1.80.0000.00817.49
8.1.70.0000.00617.29
8.1.60.0000.00817.55
8.1.50.0040.00417.40
8.1.40.0100.00317.52
8.1.30.0080.01117.68
8.1.20.0040.00717.66
8.1.10.0090.00617.54
8.1.00.0080.00417.38
8.0.300.0040.00420.07
8.0.290.0060.00316.75
8.0.280.0040.00418.48
8.0.270.0050.00216.86
8.0.260.0000.00618.35
8.0.250.0000.00616.92
8.0.240.0070.00016.90
8.0.230.0050.00317.01
8.0.220.0030.00316.88
8.0.210.0000.00716.81
8.0.200.0030.00317.02
8.0.190.0000.00917.03
8.0.180.0040.00416.82
8.0.170.0170.00216.98
8.0.160.0180.00016.93
8.0.150.0090.00616.89
8.0.140.0170.00316.92
8.0.130.0130.00716.99
8.0.120.0170.00316.95
8.0.110.0160.00316.92
8.0.100.0140.00716.88
8.0.90.0180.00416.80
8.0.80.0100.01016.95
8.0.70.0150.00616.94
8.0.60.0200.00516.90
8.0.50.0170.00316.86
8.0.30.0210.00017.00
8.0.20.0170.00316.98
8.0.10.0170.00317.00
7.4.330.0050.00015.55
7.4.320.0000.00616.45
7.4.300.0000.00616.49
7.4.290.0030.00616.58
7.4.280.0130.00916.50
7.4.270.0220.00016.57
7.4.260.0210.00016.47
7.4.250.0170.00316.54
7.4.240.0180.00416.50
7.4.230.0180.01116.56
7.4.220.0210.00716.48
7.4.210.0190.00016.56
7.4.200.0190.00016.46
7.4.190.0120.00816.64
7.4.180.0130.00516.52
7.4.160.0130.00516.57
7.4.150.0150.00416.39
7.4.140.0120.00616.45
7.4.130.0100.01016.41
7.4.120.0160.00316.45
7.4.110.0150.00516.43
7.4.100.0190.00016.47
7.4.90.0110.00816.41
7.4.80.0130.00616.44
7.4.70.0140.00416.43
7.4.60.0120.00716.51
7.4.50.0140.00516.36
7.4.40.0170.00216.34
7.4.30.0090.00916.39
7.4.20.0150.00516.48
7.4.10.0170.00016.39
7.4.00.0180.00016.40

preferences:
70.68 ms | 400 KiB | 5 Q