3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($input) { $output = htmlspecialchars($input, ENT_QUOTES, 'UTF-8'); $code = str_replace('%', '\\x', rawurlencode($input)); if (validate_utf8($input)) { echo "【{$output}】({$code}) は有効なUTF-8シーケンスです。\n"; } else { echo "({$code}) は無効なUTF-8シーケンスです。\n"; } } test("☝( ◠‿◠ )☝"); test("ゔ〲〰"); test("\x0a\x92\xff"); // てきとー test("\xef\xbb\xbf"); // BOMだっけ test(""); // 空文字列 echo "\n"; test("\x2f"); // スラッシュ(1バイト) test("\xc0\xaf"); // スラッシュ(冗長2バイト) test("\xe0\x80\xaf"); // スラッシュ(冗長3バイト) test("\xf0\x80\x80\xaf"); // スラッシュ(冗長4バイト)

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.0140.00016.75
8.3.50.0090.00921.09
8.3.40.0120.00318.67
8.3.30.0110.00418.61
8.3.20.0050.00320.16
8.3.10.0040.00423.66
8.3.00.0050.00323.53
8.2.180.0070.00716.88
8.2.170.0110.00422.96
8.2.160.0100.00320.57
8.2.150.0030.00524.18
8.2.140.0050.00324.66
8.2.130.0040.00420.98
8.2.120.0080.00026.35
8.2.110.0030.00721.02
8.2.100.0000.01217.93
8.2.90.0060.00319.13
8.2.80.0090.00017.97
8.2.70.0030.00717.63
8.2.60.0000.00717.93
8.2.50.0080.00018.07
8.2.40.0040.00422.21
8.2.30.0000.00819.44
8.2.20.0040.00717.75
8.2.10.0040.00418.00
8.2.00.0040.00417.87
8.1.280.0110.00425.92
8.1.270.0050.00922.20
8.1.260.0000.00828.09
8.1.250.0040.00428.09
8.1.240.0120.00020.56
8.1.230.0040.00719.06
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0000.01017.35
8.1.190.0040.00417.22
8.1.180.0000.00718.10
8.1.170.0060.00318.58
8.1.160.0000.00720.84
8.1.150.0070.00018.75
8.1.140.0040.00419.57
8.1.130.0040.00417.56
8.1.120.0030.00517.30
8.1.110.0050.00217.44
8.1.100.0000.00717.36
8.1.90.0040.00417.40
8.1.80.0030.00517.31
8.1.70.0000.00817.36
8.1.60.0000.00917.50
8.1.50.0040.00417.55
8.1.40.0030.00617.48
8.1.30.0040.00417.62
8.1.20.0000.00817.55
8.1.10.0040.00417.57
8.1.00.0080.00017.50
8.0.300.0040.00418.77
8.0.290.0060.00316.75
8.0.280.0080.00018.43
8.0.270.0040.00417.20
8.0.260.0080.00017.25
8.0.250.0030.00316.98
8.0.240.0000.00716.98
8.0.230.0000.00716.92
8.0.220.0070.00016.89
8.0.210.0070.00016.91
8.0.200.0000.00716.96
8.0.190.0000.00716.85
8.0.180.0040.00416.81
8.0.170.0000.00816.86
8.0.160.0030.00516.80
8.0.150.0050.00216.85
8.0.140.0000.00816.86
8.0.130.0030.00313.29
8.0.120.0030.00516.90
8.0.110.0050.00216.87
8.0.100.0000.00716.84
8.0.90.0000.00716.96
8.0.80.0120.00916.82
8.0.70.0050.00216.90
8.0.60.0050.00316.93
8.0.50.0040.00416.73
8.0.30.0120.00516.97
8.0.20.0130.01017.40
8.0.10.0030.00617.08
8.0.00.0130.00516.77
7.4.330.0000.00616.73
7.4.320.0000.00616.36
7.4.300.0000.00816.66
7.4.290.0050.00316.46
7.4.280.0000.00816.60
7.4.270.0070.00016.68
7.4.260.0070.00416.40
7.4.250.0040.00416.47
7.4.240.0030.00316.60
7.4.230.0030.00316.43
7.4.220.0040.01216.54
7.4.210.0060.01016.55
7.4.200.0020.00516.52
7.4.160.0110.00716.39
7.4.150.0140.00317.40
7.4.140.0080.01317.86
7.4.130.0110.00616.64
7.4.120.0090.00816.48
7.4.110.0040.01616.60
7.4.100.0120.00616.47
7.4.90.0090.00916.61
7.4.80.0100.00719.39
7.4.70.0180.00616.52
7.4.60.0100.00716.55
7.4.50.0070.01016.61
7.4.40.0060.01016.58
7.4.30.0130.01716.33
7.4.00.0060.00915.15
7.3.330.0000.00513.30
7.3.320.0030.00313.27
7.3.310.0000.00716.33
7.3.300.0080.00016.31
7.3.290.0040.01316.27
7.3.280.0060.01116.30
7.3.270.0070.01017.40
7.3.260.0190.01616.30
7.3.250.0120.00816.51
7.3.240.0120.00416.32
7.3.230.0080.00916.40
7.3.210.0170.00816.58
7.3.200.0070.01019.39
7.3.190.0100.01016.56
7.3.180.0130.00316.57
7.3.170.0130.01116.49
7.3.160.0030.01316.58
7.3.120.0070.01014.80
7.3.110.0040.01214.89
7.3.100.0110.00714.82
7.3.90.0000.01314.69
7.3.80.0070.00714.82
7.3.70.0100.00314.75
7.3.60.0100.00314.91
7.3.50.0000.01314.89
7.3.40.0040.00814.75
7.3.30.0000.01314.88
7.3.20.0080.00416.73
7.3.10.0060.00816.51
7.3.00.0060.00516.74
7.2.330.0030.01416.70
7.2.320.0070.01016.39
7.2.310.0030.01416.42
7.2.300.0100.00716.39
7.2.290.0100.00616.77
7.2.250.0080.00315.15
7.2.240.0120.00614.79
7.2.230.0110.00414.97
7.2.220.0090.00615.02
7.2.210.0000.01315.03
7.2.200.0030.01015.00
7.2.190.0000.01414.74
7.2.180.0040.01114.75
7.2.170.0080.00815.00
7.2.160.0100.00714.99
7.2.150.0030.01016.70
7.2.140.0070.00716.88
7.2.130.0060.00816.91
7.2.120.0060.00716.76
7.2.110.0060.01116.71
7.2.100.0170.00716.71
7.2.90.0070.01116.62
7.2.80.0050.01116.65
7.2.70.0090.00816.73
7.2.60.0050.00916.71
7.2.50.0160.00516.88
7.2.40.0090.00516.90
7.2.30.0090.00916.78
7.2.20.0160.00316.73
7.2.10.0110.00616.89
7.2.00.0140.00417.40
7.1.330.0070.01015.86
7.1.320.0090.00915.65
7.1.310.0000.01115.80
7.1.300.0030.00615.49
7.1.290.0040.00815.80
7.1.280.0030.01015.85
7.1.270.0060.00315.46
7.1.260.0070.00415.63
7.1.250.0050.00715.76
7.1.240.0110.00615.45
7.1.230.0100.00415.87
7.1.220.0100.00515.63
7.1.210.0120.00315.69
7.1.200.0140.00215.43
7.1.190.0120.01015.66
7.1.180.0040.01015.60
7.1.170.0070.00815.54
7.1.160.0110.00515.74
7.1.150.0080.00715.59
7.1.140.0160.00915.86
7.1.130.0070.01015.63
7.1.120.0110.00315.61
7.1.110.0090.00715.68
7.1.100.0050.01216.54
7.1.90.0060.00815.70
7.1.80.0100.00615.62
7.1.70.0040.00816.13
7.1.60.0110.00817.02
7.1.50.0100.01016.13
7.1.40.0100.00715.77
7.1.30.0070.00515.81
7.1.20.0090.00815.87
7.1.10.0050.00815.55
7.1.00.0070.02917.93
7.0.330.0000.01415.16
7.0.320.0030.01015.40
7.0.310.0030.01015.39
7.0.300.0080.00415.39
7.0.290.0100.00415.17
7.0.280.0040.00915.24
7.0.270.0140.00815.32
7.0.260.0070.00715.17
7.0.250.0100.00715.37
7.0.240.0050.00815.39
7.0.230.0100.00315.48
7.0.220.0110.00715.46
7.0.210.0080.00715.49
7.0.200.0070.00715.69
7.0.190.0100.00515.37
7.0.180.0100.00515.39
7.0.170.0050.00715.53
7.0.160.0080.00715.43
7.0.150.0090.00515.41
7.0.140.0050.01015.37
7.0.130.0020.00915.45
7.0.120.0100.00715.55
7.0.110.0530.00615.53
7.0.100.0080.00515.39
7.0.90.0060.00715.28
7.0.80.0110.00615.38
7.0.70.0120.00615.38
7.0.60.0080.02917.48
7.0.50.0100.03516.40
7.0.40.0100.03215.67
7.0.30.0160.02615.70
7.0.20.0130.03215.69
7.0.10.0070.03115.60
7.0.00.0080.03115.74
5.6.400.0040.00714.24
5.6.390.0000.01414.00
5.6.380.0090.00714.03
5.6.370.0050.01114.19
5.6.360.0080.00714.47
5.6.350.0080.00713.83
5.6.340.0070.00814.01
5.6.330.0060.00914.27
5.6.320.0110.00514.05
5.6.310.0060.01014.09
5.6.300.0060.00914.27
5.6.290.0060.00713.96
5.6.280.0070.01816.50
5.6.270.0070.00914.41
5.6.260.0100.00414.46
5.6.250.0100.00414.19
5.6.240.0110.00314.13
5.6.230.0070.00614.14
5.6.220.0090.00814.24
5.6.210.0090.02916.38
5.6.200.0100.02415.52
5.6.190.0100.02616.31
5.6.180.0120.01716.22
5.6.170.0120.01816.34
5.6.160.0110.01416.34
5.6.150.0040.01915.48
5.6.140.0070.02715.57
5.6.130.0040.02515.69
5.6.120.0070.02916.47
5.6.110.0070.01816.38
5.6.100.0140.02616.42
5.6.90.0120.01716.45
5.6.80.0070.03616.20
5.6.70.0050.00914.00
5.6.60.0080.00814.03
5.6.50.0080.00914.16
5.6.40.0080.00914.15
5.6.30.0090.00514.14
5.6.20.0070.00813.99
5.6.10.0080.00814.11
5.6.00.0110.00413.97
5.5.380.0040.00713.42
5.5.370.0020.00813.45
5.5.360.0090.00413.46
5.5.350.1470.01515.76
5.5.340.0020.01914.94
5.5.330.0090.02715.74
5.5.320.0250.02515.75
5.5.310.0110.01815.59
5.5.300.0100.01814.95
5.5.290.0030.02514.95
5.5.280.0030.01915.77
5.5.270.0010.03215.97
5.5.260.0060.01815.92
5.5.250.0100.02715.86
5.5.240.0100.01915.74
5.5.230.0040.00913.31
5.5.220.0070.00713.34
5.5.210.0060.00813.35
5.5.200.0040.00913.42
5.5.190.0030.00713.34
5.5.180.0080.00513.40
5.5.170.0090.00714.17
5.5.160.0050.00813.42
5.5.150.0060.00613.44
5.5.140.0050.00613.38
5.5.130.0080.00513.34
5.5.120.0080.00913.32
5.5.110.0020.00813.46
5.5.100.0080.00613.29
5.5.90.0110.00413.41
5.5.80.0100.00513.55
5.5.70.0100.00513.41
5.5.60.0060.00813.47
5.5.50.0050.00913.28
5.5.40.0080.00313.40
5.5.30.0060.00813.35
5.5.20.0070.00613.52
5.5.10.0020.01013.39
5.5.00.0050.00913.53

preferences:
51.07 ms | 401 KiB | 5 Q