3v4l.org

run code in 300+ PHP versions simultaneously
<?php function is_utf8($string) { if (strlen($string) == 0) { return true; } return preg_match('%^(?: [\x09\x0A\x0D\x20-\x7E] # ASCII | [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte | \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte | \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates | \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3 | [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15 | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16 )*$%xs', $string); } $string = "1234567890123456789012345678..."; echo strlen($string); var_dump(is_utf8($string));

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.0150.00616.75
8.3.50.0100.00817.58
8.3.40.0110.00418.97
8.3.30.0000.01518.84
8.3.20.0030.00618.81
8.3.10.0040.00420.60
8.3.00.0030.00519.50
8.2.180.0090.00916.75
8.2.170.0120.00322.96
8.2.160.0100.00718.91
8.2.150.0000.00824.18
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0080.00021.08
8.2.110.0070.00319.27
8.2.100.0090.00317.91
8.2.90.0030.00621.16
8.2.80.0040.00419.41
8.2.70.0000.00817.73
8.2.60.0040.00418.03
8.2.50.0050.00318.07
8.2.40.0050.00218.02
8.2.30.0000.00717.98
8.2.20.0030.00619.58
8.2.10.0040.00417.90
8.2.00.0090.00017.68
8.1.280.0120.00625.92
8.1.270.0040.00424.66
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00323.79
8.1.230.0080.00420.91
8.1.220.0060.00317.76
8.1.210.0050.00318.89
8.1.200.0060.00317.25
8.1.190.0040.00417.63
8.1.180.0080.00018.10
8.1.170.0030.00518.89
8.1.160.0040.00419.00
8.1.150.0040.00418.68
8.1.140.0040.00417.51
8.1.130.0030.00317.82
8.1.120.0000.00717.68
8.1.110.0000.00817.59
8.1.100.0040.00417.54
8.1.90.0000.00717.52
8.1.80.0040.00417.57
8.1.70.0030.00317.62
8.1.60.0000.00917.72
8.1.50.0000.00817.66
8.1.40.0060.00317.69
8.1.30.0050.00317.73
8.1.20.0000.00817.89
8.1.10.0040.00417.67
8.1.00.0070.00017.47
8.0.300.0040.00420.11
8.0.290.0050.00216.75
8.0.280.0000.00718.33
8.0.270.0050.00317.43
8.0.260.0030.00317.09
8.0.250.0030.00317.02
8.0.240.0030.00417.13
8.0.230.0040.00417.08
8.0.220.0070.00017.00
8.0.210.0040.00417.02
8.0.200.0030.00316.92
8.0.190.0050.00317.11
8.0.180.0000.00717.02
8.0.170.0090.00016.89
8.0.160.0050.00316.88
8.0.150.0070.00016.97
8.0.140.0000.00716.98
8.0.130.0030.00313.45
8.0.120.0050.00217.02
8.0.110.0000.00716.88
8.0.100.0000.00817.04
8.0.90.0040.00416.86
8.0.80.0090.00617.09
8.0.70.0050.00217.05
8.0.60.0050.00217.09
8.0.50.0040.00416.91
8.0.30.0100.01017.10
8.0.20.0150.00317.18
8.0.10.0000.00717.30
8.0.00.0160.00717.19
7.4.330.0050.00013.20
7.4.320.0030.00316.82
7.4.300.0000.00716.88
7.4.290.0030.00316.73
7.4.280.0030.00616.89
7.4.270.0080.00016.65
7.4.260.0030.00313.62
7.4.250.0030.00516.86
7.4.240.0040.00316.85
7.4.230.0030.00516.71
7.4.220.0090.01016.68
7.4.210.0080.00916.83
7.4.200.0030.00316.53
7.4.190.0000.00716.97
7.4.160.0110.00616.81
7.4.150.0130.00616.75
7.4.140.0110.00916.79
7.4.130.0080.01116.89
7.4.120.0100.00716.57
7.4.110.0060.01216.82
7.4.100.0070.01016.62
7.4.90.0180.00016.87
7.4.80.0070.01119.39
7.4.70.0100.01316.70
7.4.60.0120.00316.91
7.4.50.0040.00916.70
7.4.40.0040.01416.79
7.4.30.0070.01016.64
7.4.10.0070.01115.16
7.4.00.0100.00515.11
7.3.330.0030.00313.30
7.3.320.0000.00813.46
7.3.310.0000.00716.34
7.3.300.0000.00716.45
7.3.290.0100.00616.39
7.3.280.0130.00716.44
7.3.270.0100.00716.54
7.3.260.0090.01016.53
7.3.250.0120.00816.66
7.3.240.0130.00716.71
7.3.230.0110.00716.66
7.3.210.0080.00816.49
7.3.200.0150.00316.72
7.3.190.0080.01216.52
7.3.180.0040.01116.84
7.3.170.0110.00716.83
7.3.160.0080.00816.60
7.3.130.0030.01515.13
7.3.120.0060.01015.02
7.3.110.0040.01115.07
7.3.100.0070.00614.99
7.3.90.0000.01415.13
7.3.80.0040.01115.00
7.3.70.0060.01015.11
7.3.60.0080.00614.97
7.3.50.0030.01014.75
7.3.40.0030.01015.05
7.3.30.0070.01015.14
7.3.20.0090.00616.77
7.3.10.0000.01316.97
7.3.00.0030.01016.97
7.2.330.0100.00716.65
7.2.320.0170.00416.76
7.2.310.0070.01716.84
7.2.300.0130.00716.73
7.2.290.0090.00916.96
7.2.260.0080.01115.31
7.2.250.0040.01115.22
7.2.240.0120.00314.98
7.2.230.0080.00815.20
7.2.220.0060.00915.29
7.2.210.0130.00315.16
7.2.200.0030.00915.27
7.2.190.0060.01015.20
7.2.180.0100.00615.15
7.2.170.0040.01115.28
7.2.160.0090.00615.24
7.2.150.0070.00717.24
7.2.140.0080.00616.93
7.2.130.0090.00317.27
7.2.120.0090.00617.07
7.2.110.0060.01016.83
7.2.100.0100.00316.94
7.2.90.0000.01316.98
7.2.80.0070.00716.95
7.2.70.0030.00717.17
7.2.60.0060.00916.78
7.2.50.0000.01117.02
7.2.40.0100.00317.00
7.2.30.0000.01617.14
7.2.20.0090.00316.99
7.2.10.0070.00716.95
7.2.00.0070.00718.37
7.1.330.0030.01016.07
7.1.320.0090.00615.93
7.1.310.0090.00616.07
7.1.300.0070.01016.02
7.1.290.0060.00615.96
7.1.280.0030.00516.01
7.1.270.0030.00916.04
7.1.260.0070.00316.10
7.1.250.0070.01015.83
7.1.240.0000.00915.84
7.1.230.0130.00015.70
7.1.220.0080.00415.64
7.1.210.0080.00015.98
7.1.200.0000.00915.93
7.1.190.0060.00316.00
7.1.180.0090.00616.02
7.1.170.0090.00915.80
7.1.160.0060.00915.91
7.1.150.0030.01015.91
7.1.140.0070.00716.01
7.1.130.0000.00816.00
7.1.120.0120.00316.04
7.1.110.0000.00816.02
7.1.100.0040.00917.17
7.1.90.0000.01515.99
7.1.80.0090.00315.93
7.1.70.0010.00816.63
7.1.60.0050.01017.74
7.1.50.0040.00916.55
7.1.40.0000.01315.73
7.1.30.0100.00315.80
7.1.20.0120.00316.00
7.1.10.0080.00615.87
7.1.00.0030.04319.26
7.0.330.0000.01515.52
7.0.320.0000.00915.66
7.0.310.0030.00615.63
7.0.300.0030.00715.27
7.0.290.0040.01115.70
7.0.280.0040.00715.41
7.0.270.0000.01315.54
7.0.260.0110.00415.71
7.0.250.0070.00315.80
7.0.240.0060.00615.53
7.0.230.0100.00315.51
7.0.220.0100.00715.38
7.0.210.0030.00615.75
7.0.200.0060.00815.43
7.0.190.0060.00615.61
7.0.180.0030.01015.57
7.0.170.0000.01015.78
7.0.160.0040.00415.70
7.0.150.0040.01115.40
7.0.140.0050.04018.79
7.0.130.0120.00015.74
7.0.120.0070.03718.85
7.0.110.0060.00615.77
7.0.100.0070.00715.64
7.0.90.0070.00715.55
7.0.80.0040.00715.49
7.0.70.0070.00715.67
7.0.60.0070.03517.78
7.0.50.0090.04316.82
7.0.40.1790.02616.80
7.0.30.1690.02316.99
7.0.20.2090.02616.86
7.0.10.2120.02817.03
7.0.00.1820.02316.88
5.6.400.0060.00614.30
5.6.390.0040.01114.72
5.6.380.0030.00614.42
5.6.370.0060.00814.46
5.6.360.0000.00914.56
5.6.350.0060.00614.64
5.6.340.0030.00914.64
5.6.330.0000.01314.51
5.6.320.0060.00914.69
5.6.310.0040.01014.69
5.6.300.0040.00813.86
5.6.290.0070.01014.58
5.6.280.0070.03417.86
5.6.270.0030.00714.31
5.6.260.0030.01014.33
5.6.250.0070.00714.17
5.6.240.0060.00914.48
5.6.230.0060.00614.50
5.6.220.0100.00314.51
5.6.210.0030.04817.67
5.6.200.0120.03616.40
5.6.190.1750.02817.53
5.6.180.1870.02617.40
5.6.170.1850.02717.49
5.6.160.1770.02717.39
5.6.150.1820.02817.33
5.6.140.1800.02317.38
5.6.130.1620.02717.35
5.6.120.0470.03717.43
5.6.110.0050.02917.36
5.6.100.1820.02717.44
5.6.90.1570.03117.24
5.6.80.1770.02717.09
5.6.70.1350.02716.99
5.6.60.1370.02417.24
5.6.50.1580.02317.02
5.6.40.1640.02517.18
5.6.30.1480.02316.91
5.6.20.1480.02017.07
5.6.10.1970.02716.87
5.6.00.1570.03016.99
5.5.380.0060.00914.13
5.5.370.0030.01014.48
5.5.360.0070.00714.15
5.5.350.0120.04617.38
5.5.340.0080.04016.12
5.5.330.0660.04117.36
5.5.320.1830.02617.39
5.5.310.2070.02717.23
5.5.300.1780.02617.30
5.5.290.2100.02217.33
5.5.280.0030.04817.15
5.5.270.0080.03117.34
5.5.260.1810.02217.37
5.5.250.1830.02717.04
5.5.240.1530.01616.90
5.5.230.1430.02316.91
5.5.220.1530.02316.92
5.5.210.1530.02516.89
5.5.200.1640.02116.80
5.5.190.1600.02616.81
5.5.180.1600.02516.81
5.5.170.0030.00714.31
5.5.160.1600.02416.82
5.5.150.1650.02517.05
5.5.140.1340.02416.79
5.5.130.1860.02316.86
5.5.120.1620.02716.92
5.5.110.1460.02217.05
5.5.100.1620.02716.81
5.5.90.1570.02416.95
5.5.80.1450.02116.99
5.5.70.1540.02316.78
5.5.60.1750.02316.69
5.5.50.1580.02516.87
5.5.40.1970.02016.81
5.5.30.1950.02316.90
5.5.20.1620.02016.71
5.5.10.1630.02216.94
5.5.00.1430.02816.87
5.4.450.1930.02016.21
5.4.440.0050.03216.18
5.4.430.0640.03616.13
5.4.420.1650.02016.19
5.4.410.1730.02316.10
5.4.400.1600.02216.01
5.4.390.1630.02316.07
5.4.380.1610.01516.05
5.4.370.1730.02515.97
5.4.360.1600.02416.07
5.4.350.1570.02616.09
5.4.340.1620.01816.05
5.4.330.0040.00813.02
5.4.320.1630.02116.07
5.4.310.1630.02216.05
5.4.300.1710.01816.15
5.4.290.1620.02316.00
5.4.280.1810.01616.04
5.4.270.1490.02016.00
5.4.260.1560.02316.09
5.4.250.1450.02016.04
5.4.240.1730.02116.03
5.4.230.1470.02016.15
5.4.220.1760.02116.08
5.4.210.1770.02016.03
5.4.200.1480.02516.03
5.4.190.2000.02115.96
5.4.180.1730.02916.04
5.4.170.1620.02016.09
5.4.160.1470.01816.00
5.4.150.1770.02016.04
5.4.140.1600.01814.70
5.4.130.1480.02414.69
5.4.120.1520.02214.82
5.4.110.1450.02414.82
5.4.100.1470.02214.79
5.4.90.1480.02314.70
5.4.80.1460.01914.70
5.4.70.1300.02014.69
5.4.60.1320.01914.72
5.4.50.0080.03814.71
5.4.40.0050.02314.71
5.4.30.0420.02314.72
5.4.20.1620.02314.62
5.4.10.1560.02314.70
5.4.00.1520.01914.46
5.3.290.1600.02413.90
5.3.280.1480.02513.80
5.3.270.1500.02413.81
5.3.260.1450.02213.85
5.3.250.1350.02213.85
5.3.240.1460.02113.83
5.3.230.1420.02513.84
5.3.220.1490.02213.83
5.3.210.1450.02113.83
5.3.200.1520.01713.81
5.3.190.1370.01913.83
5.3.180.1480.02413.82
5.3.170.1370.02613.79
5.3.160.1520.01813.79
5.3.150.1660.02313.85
5.3.140.0080.01913.81
5.3.130.1650.02713.81
5.3.120.1600.02213.79
5.3.110.1620.02013.81
5.3.100.1490.01713.56
5.3.90.1630.02313.58
5.3.80.1610.02213.55
5.3.70.1630.02313.48
5.3.60.1450.02213.56
5.3.50.1580.02713.51
5.3.40.1550.02113.61
5.3.30.1750.02213.49
5.3.20.1930.02013.36
5.3.10.1770.02013.35
5.3.00.0010.04413.35
5.2.170.2800.02711.17
5.2.160.2970.03311.05
5.2.150.2800.03311.18
5.2.140.3470.02711.22
5.2.130.3030.03311.12
5.2.120.2870.02311.20
5.2.110.1200.02711.12
5.2.100.0070.06011.01
5.2.90.0030.04011.15
5.2.80.1000.04011.07
5.2.70.3200.03711.09
5.2.60.2900.02711.13
5.2.50.2500.03711.25
5.2.40.2270.03310.88
5.2.30.2200.02711.03
5.2.20.2130.02311.09
5.2.10.1930.03311.09
5.2.00.2100.03010.78
5.1.60.2330.02710.00
5.1.50.2430.0279.95
5.1.40.2900.0239.97
5.1.30.2530.02310.33
5.1.20.2930.02010.47
5.1.10.2870.0239.92
5.1.00.2830.02710.15
5.0.50.1630.0278.51
5.0.40.1570.0238.49
5.0.30.1570.0308.27
5.0.20.1670.0208.29
5.0.10.1670.0138.40
5.0.00.1670.0338.16
4.4.90.1270.0205.86
4.4.80.1200.0235.84
4.4.70.0870.0135.82
4.4.60.0800.0135.88
4.4.50.0800.0135.86
4.4.40.1430.0275.81
4.4.30.1500.0135.83
4.4.20.1500.0175.96
4.4.10.1570.0175.98
4.4.00.1500.0235.94
4.3.110.1230.0205.74
4.3.100.1600.0135.79
4.3.90.1630.0135.85
4.3.80.1230.0275.81
4.3.70.1430.0175.78
4.3.60.1470.0205.81
4.3.50.1300.0135.82
4.3.40.1600.0335.69
4.3.30.0730.0205.26
4.3.20.0870.0235.26
4.3.10.0900.0275.26
4.3.00.0870.0175.26

preferences:
42.44 ms | 401 KiB | 5 Q