3v4l.org

run code in 300+ PHP versions simultaneously
<?php $boms = array("\xef\xbf\xbe" => '', "\xef\xbf\xbf" => '',); $array = array( "BOMがマルチバイト文字に分断されたもの"=>"あ\xefい\xbf\xbeう\xef\xbfえ\xbfお", "制御文字でBOMが分断されたもの" => "あい\xef\xbf\x07\xbeう\xef\x1f\xbf\xbfえお", "U+FFFE" => "\xef\xbf\xbe", "U+FFFF" => "\xef\xbf\xbf", "1バイト" => "\xef", "2バイト" => "\xef\xbf", "おしい" => "\xef\xbf\x6a" ); foreach($array as $key => $str) { echo $key . " "; echo var_dump(strpos($str, key($boms))); }

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.20.0200.00017.55
8.4.10.0100.00717.81
8.3.150.0040.01519.11
8.3.140.0140.00017.39
8.3.130.0040.00418.21
8.3.120.0040.00418.95
8.3.110.0120.00320.94
8.3.100.0080.00024.06
8.3.90.0040.00426.77
8.3.80.0080.00317.97
8.3.70.0070.01116.50
8.3.60.0160.00618.43
8.3.50.0140.00521.10
8.3.40.0110.00418.71
8.3.30.0070.00719.07
8.3.20.0050.00220.34
8.3.10.0090.00021.73
8.3.00.0080.00017.25
8.2.270.0140.00518.84
8.2.260.0100.01016.23
8.2.250.0000.00818.27
8.2.240.0040.01116.99
8.2.230.0000.00822.58
8.2.220.0130.00337.54
8.2.210.0100.01026.77
8.2.200.0070.00316.50
8.2.190.0170.00316.58
8.2.180.0130.00316.50
8.2.170.0100.00722.96
8.2.160.0030.01020.52
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0030.00526.16
8.2.120.0040.00422.08
8.2.110.0070.00319.18
8.2.100.0080.00417.50
8.2.90.0070.00019.08
8.2.80.0030.00517.97
8.2.70.0030.00817.38
8.2.60.0080.00017.80
8.2.50.0040.00418.07
8.2.40.0030.00618.09
8.2.30.0040.00417.98
8.2.20.0070.00017.71
8.2.10.0030.00518.05
8.2.00.0040.00418.05
8.1.310.0070.00018.38
8.1.300.0030.00617.89
8.1.290.0000.01030.84
8.1.280.0120.00325.92
8.1.270.0000.00920.25
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0070.00319.12
8.1.230.0060.00617.48
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0030.00617.25
8.1.190.0080.00017.23
8.1.180.0080.00018.10
8.1.170.0030.00618.59
8.1.160.0070.00021.93
8.1.150.0040.00420.58
8.1.140.0040.00417.36
8.1.130.0040.00417.75
8.1.120.0080.00017.34
8.1.110.0000.00717.34
8.1.100.0070.00017.43
8.1.90.0040.00417.37
8.1.80.0000.00817.42
8.1.70.0070.00017.39
8.1.60.0060.00317.52
8.1.50.0040.00417.56
8.1.40.0040.00417.40
8.1.30.0080.00017.68
8.1.20.0040.00417.63
8.1.10.0070.00017.40
8.1.00.0060.00317.45
8.0.300.0070.00018.77
8.0.290.0000.00816.75
8.0.280.0030.00518.49
8.0.270.0070.00016.73
8.0.260.0000.00617.21
8.0.250.0000.00716.93
8.0.240.0000.00716.98
8.0.230.0000.00716.92
8.0.220.0070.00016.95
8.0.210.0050.00216.78
8.0.200.0060.00016.99
8.0.190.0040.00417.00
8.0.180.0000.01016.90
8.0.170.0040.00416.74
8.0.160.0000.00716.80
8.0.150.0070.00016.85
8.0.140.0050.00216.74
8.0.130.0070.00013.32
8.0.120.0040.00416.76
8.0.110.0000.00716.82
8.0.100.0040.00416.80
8.0.90.0000.00716.93
8.0.80.0030.01016.87
8.0.70.0040.00416.90
8.0.60.0030.00616.85
8.0.50.0000.00716.68
8.0.30.0100.00917.12
8.0.20.0120.00617.40
8.0.10.0050.00216.82
8.0.00.0090.00816.92
7.4.330.0000.00515.04
7.4.320.0030.00316.43
7.4.300.0040.00416.50
7.4.290.0060.00016.57
7.4.280.0050.00216.51
7.4.270.0040.00416.42
7.4.260.0000.00716.50
7.4.250.0000.00916.46
7.4.240.0050.00216.61
7.4.230.0030.00316.51
7.4.220.0070.01116.44
7.4.210.0100.01016.41
7.4.200.0000.00716.70
7.4.160.0120.00416.67
7.4.150.0070.01017.40
7.4.140.0160.01017.86
7.4.130.0120.00816.56
7.4.120.0120.00816.57
7.4.110.0060.01616.49
7.4.100.0100.01116.56
7.4.90.0110.00716.32
7.4.80.0070.01019.39
7.4.70.0080.01116.55
7.4.60.0060.01016.62
7.4.50.0030.00516.45
7.4.40.0030.01616.39
7.4.30.0030.01316.32
7.4.00.0120.00314.59
7.3.330.0000.00513.17
7.3.320.0030.00313.06
7.3.310.0000.00716.20
7.3.300.0000.00716.16
7.3.290.0080.00816.27
7.3.280.0130.00516.27
7.3.270.0100.01317.40
7.3.260.0100.00716.28
7.3.240.0110.01016.31
7.3.230.0130.00316.39
7.3.210.0070.01616.29
7.3.200.0150.00319.39
7.3.190.0130.00316.56
7.3.180.0030.01316.22
7.3.170.0090.00916.27
7.3.160.0150.00016.46
7.2.330.0070.01016.57
7.2.320.0080.00816.51
7.2.310.0070.01016.56
7.2.300.0100.00616.68
7.2.290.0130.00916.70
7.2.60.0070.00416.88
7.2.50.0100.00717.01
7.1.200.0120.00315.63
7.1.70.0110.00016.86
7.1.60.0000.02419.59
7.1.50.0090.01616.96
7.1.00.0000.08022.30
7.0.200.0140.00316.80
7.0.60.0030.07319.91
7.0.50.0000.06717.87
7.0.40.0070.08320.40
7.0.30.0170.05320.39
7.0.20.0300.07720.18
7.0.10.0100.08720.20
7.0.00.0070.04020.17
5.6.280.0030.07321.04
5.6.210.0070.08320.69
5.6.200.0070.04318.19
5.6.190.0170.09020.41
5.6.180.0270.05020.27
5.6.170.0330.05020.52
5.6.160.0030.05020.61
5.6.150.0100.07318.20
5.6.140.0100.07718.09
5.6.130.0130.07318.17
5.6.120.0130.04020.99
5.6.110.0070.09021.11
5.6.100.0170.07321.00
5.6.90.0100.04021.00
5.6.80.0070.07320.53
5.5.350.0230.04020.37
5.5.340.0000.06017.89
5.5.330.0070.04320.21
5.5.320.0030.06320.20
5.5.310.0170.06720.18
5.5.300.0000.08017.91
5.5.290.0030.08317.90
5.5.280.0030.04720.80
5.5.270.0100.08320.78
5.5.260.0070.08320.94
5.5.250.0030.09020.77
5.5.240.0030.08320.16
5.4.450.0530.05019.28
5.4.440.0530.06319.51
5.4.430.0730.05019.36
5.4.420.0600.05719.45
5.4.410.0700.06719.37
5.4.400.0670.04719.09
5.4.390.0770.04018.79
5.4.380.0800.03718.94
5.4.370.0570.05718.98
5.4.360.0570.05718.78
5.4.350.0600.05019.22
5.4.340.0630.05318.94
5.4.320.0730.04019.17
5.4.310.0570.05018.78
5.4.300.0600.05019.05
5.4.290.0700.04718.80
5.4.280.0570.06719.14
5.4.270.0600.05318.78
5.4.260.0530.05718.93
5.4.250.0570.05719.16
5.4.240.0670.04318.77
5.4.230.0530.06018.88
5.4.220.0570.05719.08
5.4.210.0670.04318.80
5.4.200.0630.05016.57
5.4.190.0670.05018.98
5.4.180.0600.05018.80
5.4.170.0530.06719.09
5.4.160.0670.04319.09
5.4.150.0630.06718.96
5.4.140.0700.04316.39
5.4.130.0570.05016.57
5.4.120.0870.03716.28
5.4.110.0870.04716.21
5.4.100.0830.04016.33
5.4.90.0630.05316.38
5.4.80.0630.04716.20
5.4.70.0630.06016.54
5.4.60.0700.05016.18
5.4.50.0770.04716.30
5.4.40.0870.06016.38
5.4.30.0700.05016.14
5.4.20.0670.05316.29
5.4.10.0370.04716.09
5.4.00.0000.05315.79
5.3.290.0130.06714.59
5.3.280.0370.05714.43
5.3.270.0570.06014.49
5.3.260.0870.04314.50
5.3.250.0730.05014.47
5.3.240.0800.04714.45
5.3.230.0670.05714.54
5.3.220.0630.05014.60
5.3.210.0600.05714.62
5.3.200.0600.05314.58
5.3.190.0830.04314.32
5.3.180.0730.04014.39
5.3.170.0700.04714.45
5.3.160.0700.05314.40
5.3.150.0670.06314.46
5.3.140.0870.03314.56
5.3.130.0830.07314.43
5.3.120.0770.05014.42
5.3.110.0800.04714.42
5.3.100.0870.05713.91
5.3.90.0700.05314.02
5.3.80.0670.05713.86
5.3.70.0730.04713.96
5.3.60.0670.05713.84
5.3.50.0700.04713.86
5.3.40.0700.05013.82
5.3.30.0670.05013.82
5.3.20.0770.06313.52
5.3.10.0670.05313.45
5.3.00.0770.04313.48
5.2.170.0630.03711.01
5.2.160.0530.04311.04
5.2.150.0570.04311.22
5.2.140.0500.04011.24
5.2.130.0470.04011.11
5.2.120.0400.04710.96
5.2.110.0670.03310.96
5.2.100.0600.03711.00
5.2.90.0600.04011.16
5.2.80.0600.04011.10
5.2.70.0530.04710.96
5.2.60.0670.03310.96
5.2.50.0600.04010.85
5.2.40.0500.03710.84
5.2.30.0500.03010.76
5.2.20.0500.03310.71
5.2.10.0470.03710.85
5.2.00.0470.04010.76
5.1.60.0400.0339.91
5.1.50.0530.0409.84
5.1.40.0500.04310.01
5.1.30.0470.05310.40
5.1.20.0470.03710.34
5.1.10.0470.03710.04
5.1.00.0400.0379.99
5.0.50.0230.0308.63
5.0.40.0230.0278.47
5.0.30.0330.0378.12
5.0.20.0230.0238.14
5.0.10.0200.0338.05
5.0.00.0270.0378.14
4.4.90.0270.0205.76
4.4.80.0230.0235.73
4.4.70.0230.0205.89
4.4.60.0200.0305.79
4.4.50.0200.0235.82
4.4.40.0170.0405.86
4.4.30.0300.0205.84
4.4.20.0270.0205.79
4.4.10.0200.0275.83
4.4.00.0230.0335.89
4.3.110.0230.0235.81
4.3.100.0230.0235.70
4.3.90.0230.0205.77
4.3.80.0230.0375.76
4.3.70.0230.0205.77
4.3.60.0200.0235.78
4.3.50.0300.0275.73
4.3.40.0230.0335.71
4.3.30.0130.0204.57
4.3.20.0100.0234.44
4.3.10.0170.0174.36
4.3.00.0070.0237.13

preferences:
30.02 ms | 403 KiB | 5 Q