3v4l.org

run code in 300+ PHP versions simultaneously
<?php $acceptFormat = array( 'jpg' => 'image/jpeg', 'jpg' => 'image/jpg', 'png' => 'image/png' ); $ext ='jpg'; if (!in_array($ext,array_keys($acceptFormat))) { throw new RuntimeException('Invalid file format.'); } $mime = 'video/mkv'; if (!in_array($mime,array_values($acceptFormat))) { throw new RuntimeException('Invalid mime format.'); }

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.4.120.0100.00723.95
8.4.110.0070.00820.61
8.4.100.0100.01117.87
8.4.90.0070.00418.54
8.4.80.0140.00718.27
8.4.70.0080.01019.79
8.4.60.0100.01218.79
8.4.50.0110.01018.14
8.4.40.0000.00819.53
8.4.30.0160.00017.71
8.4.20.0130.00620.65
8.4.10.0030.00617.79
8.3.250.0090.00818.73
8.3.240.0120.00816.95
8.3.230.0150.00516.77
8.3.220.0060.00217.20
8.3.210.0080.00816.66
8.3.200.0050.00316.69
8.3.190.0110.00617.00
8.3.180.0090.01116.86
8.3.170.0120.00319.01
8.3.160.0150.00317.14
8.3.150.0130.00317.13
8.3.140.0040.00416.63
8.3.130.0060.00316.85
8.3.120.0030.00618.89
8.3.110.0060.00316.80
8.3.100.0040.00416.59
8.3.90.0070.00326.77
8.3.80.0110.00019.36
8.3.70.0030.01316.63
8.3.60.0150.00018.43
8.3.50.0070.00717.17
8.3.40.0070.00718.80
8.3.30.0080.00818.84
8.3.20.0030.00618.82
8.3.10.0070.00021.60
8.3.00.0040.00423.66
8.2.290.0060.00320.46
8.2.280.0100.00920.35
8.2.270.0090.00917.15
8.2.260.0030.00516.50
8.2.250.0040.00418.71
8.2.240.0090.00916.93
8.2.230.0030.00720.94
8.2.220.0040.00424.06
8.2.210.0040.00426.77
8.2.200.0090.00018.88
8.2.190.0030.01618.54
8.2.180.0110.00718.29
8.2.170.0110.00722.96
8.2.160.0100.01019.18
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0070.00020.77
8.2.120.0140.00426.35
8.2.110.0040.00820.86
8.2.100.0070.00317.91
8.2.90.0040.00419.57
8.2.80.0030.00617.97
8.2.70.0040.00417.80
8.2.60.0090.00018.03
8.2.50.0000.00818.10
8.2.40.0040.00419.20
8.2.30.0050.00220.60
8.2.20.0040.00417.93
8.2.10.0030.00317.99
8.2.00.0000.00818.16
8.1.330.0090.01021.96
8.1.320.0110.00816.00
8.1.310.0100.00318.44
8.1.300.0090.00018.21
8.1.290.0060.00330.84
8.1.280.0180.00925.92
8.1.270.0080.00020.26
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0100.00020.45
8.1.230.0110.00022.73
8.1.220.0000.00817.79
8.1.210.0000.00818.77
8.1.200.0050.00517.48
8.1.190.0000.00817.66
8.1.180.0000.00818.10
8.1.170.0090.00018.66
8.1.160.0000.00718.94
8.1.150.0070.00018.88
8.1.140.0040.00418.89
8.1.130.0070.00020.17
8.1.120.0040.00417.45
8.1.110.0000.00817.48
8.1.100.0050.00217.48
8.1.90.0000.00717.43
8.1.80.0030.00617.36
8.1.70.0030.00317.51
8.1.60.0000.00917.46
8.1.50.0080.00017.52
8.1.40.0070.00017.41
8.1.30.0030.00617.65
8.1.20.0080.00017.57
8.1.10.0040.00417.46
8.1.00.0050.00217.46
8.0.300.0040.00419.64
8.0.290.0040.00416.75
8.0.280.0030.00318.45
8.0.270.0000.00717.09
8.0.260.0030.00320.07
8.0.250.0000.00717.02
8.0.240.0030.00516.90
8.0.230.0070.00016.90
8.0.220.0070.00016.93
8.0.210.0030.00316.94
8.0.200.0000.00816.89
8.0.190.0000.00916.90
8.0.180.0080.00016.94
8.0.170.0000.00816.97
8.0.160.0030.00416.92
8.0.150.0070.00016.96
8.0.140.0030.00516.93
8.0.130.0050.00013.38
8.0.120.0000.00716.80
8.0.110.0040.00416.89
8.0.100.0000.00816.80
8.0.90.0030.00316.81
8.0.80.0060.00716.93
8.0.70.0000.00816.98
8.0.60.0040.00416.90
8.0.50.0040.00417.05
8.0.30.0100.00817.12
8.0.20.0180.01217.40
8.0.10.0070.00016.95
8.0.00.0110.00616.85
7.4.330.0040.00015.55
7.4.320.0000.00716.64
7.4.300.0030.00316.48
7.4.290.0070.00016.59
7.4.280.0000.00716.60
7.4.270.0030.00316.58
7.4.260.0040.00416.39
7.4.250.0030.00316.54
7.4.240.0000.00716.53
7.4.230.0070.00016.33
7.4.220.0000.00816.62
7.4.210.0090.00816.57
7.4.200.0030.00316.40
7.4.160.0080.01016.48
7.4.140.0090.01117.86
7.4.130.0060.01916.71
7.4.120.0120.00816.57
7.4.110.0120.00916.67
7.4.100.0200.00316.41
7.4.90.0150.00616.48
7.4.80.0140.00419.39
7.4.70.0090.00916.48
7.4.60.0120.00816.53
7.4.50.0070.01016.44
7.4.40.0110.01116.59
7.4.00.0090.00414.89
7.3.330.0070.00012.98
7.3.320.0050.00013.09
7.3.310.0000.00716.18
7.3.300.0070.00016.30
7.3.290.0070.00016.27
7.3.280.0110.00716.24
7.3.260.0100.01216.33
7.3.240.0110.00816.46
7.3.230.0110.00616.58
7.3.210.0140.01116.50
7.3.200.0030.01316.45
7.3.190.0150.00016.55
7.3.180.0190.01416.50
7.3.170.0030.01216.27
7.3.160.0060.01216.24
7.3.120.0130.00714.55
7.3.110.0030.00914.86
7.3.100.0130.00314.80
7.3.90.0100.00714.68
7.3.80.0000.01314.71
7.3.70.0070.01014.85
7.3.60.0090.00614.48
7.3.50.0090.00014.92
7.3.40.0080.00814.56
7.3.30.0000.01814.73
7.3.20.0090.00616.55
7.3.10.0090.00916.48
7.3.00.0070.00716.53
7.2.330.0130.00816.34
7.2.320.0070.01016.66
7.2.310.0030.01516.66
7.2.300.0110.00516.71
7.2.290.0130.00416.30
7.2.250.0070.00714.92
7.2.240.0000.02115.21
7.2.230.0120.00314.95
7.2.220.0080.00414.96
7.2.210.0030.00615.02
7.2.200.0080.00815.05
7.2.190.0030.01214.66
7.2.180.0090.00314.67
7.2.170.0060.01215.00
7.2.100.6390.01014.54
7.2.90.7020.00614.20
7.2.80.4540.01014.56
7.2.70.3400.00314.55
7.2.60.3910.01614.24
7.2.50.4000.00314.85
7.2.40.3430.01714.80
7.2.30.3700.00314.48
7.2.20.2790.00314.57
7.2.10.3380.00614.81
7.2.00.0260.00714.64
7.1.330.0120.00315.73
7.1.320.0060.00615.84
7.1.310.0070.01015.60
7.1.300.0000.01315.31
7.1.290.0060.00615.46
7.1.280.0070.01015.79
7.1.270.0030.01215.78
7.1.260.0000.01015.89
7.1.220.2510.01313.51
7.1.210.4660.01013.61
7.1.200.4820.00713.87
7.1.190.4570.00713.25
7.1.180.4460.00313.89
7.1.170.3880.00713.70
7.1.160.3760.00613.32
7.1.150.3560.00713.36
7.1.140.4920.00313.77
7.1.130.3830.00313.91
7.1.120.1550.01013.74
7.1.110.1680.01014.08
7.1.100.0130.00713.41
7.1.90.0130.00713.55
7.1.80.0170.00913.25
7.1.70.0160.00413.43
7.1.60.0930.01331.30
7.1.50.0320.00731.37
7.1.40.0270.01331.45
7.1.30.4790.01631.63
7.1.20.2480.00731.77
7.1.10.0160.00613.46
7.1.00.0140.00413.54
5.6.380.0150.00613.91

preferences:
136.11 ms | 403 KiB | 5 Q