3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'Zoë'; var_dump(substr($string, -1)); var_dump(mb_substr($string, -1)); var_dump(grapheme_substr($string, -1));

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.0160.00617.75
8.3.50.0040.01119.11
8.3.40.0190.00319.77
8.3.30.0150.00019.72
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0080.00026.16
8.2.180.0130.00325.92
8.2.170.0110.00422.96
8.2.160.0070.00722.96
8.2.150.0050.00325.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0060.00326.16
8.2.110.0030.00623.19
8.2.100.0090.00318.59
8.2.90.0050.00318.78
8.2.80.0080.00318.91
8.2.70.0080.00418.38
8.2.60.0030.00618.55
8.2.50.0070.00418.38
8.2.40.0090.00020.88
8.2.30.0030.00918.87
8.2.20.0000.00719.01
8.2.10.0050.00320.24
8.2.00.0040.00420.10
8.1.280.0190.00025.92
8.1.270.0000.00823.99
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00323.42
8.1.230.0170.00018.70
8.1.220.0060.00318.66
8.1.210.0110.00019.74
8.1.200.0070.00418.36
8.1.190.0080.00318.23
8.1.180.0000.01018.10
8.1.170.0090.00319.45
8.1.160.0090.00519.84
8.1.150.0000.00719.89
8.1.140.0000.00719.76
8.1.130.0030.00518.38
8.1.120.0000.00818.45
8.1.110.0030.00918.27
8.1.100.0060.00318.33
8.1.90.0040.00418.27
8.1.80.0050.00318.39
8.1.70.0040.00418.38
8.1.60.0040.00418.51
8.1.50.0000.00918.39
8.1.40.0080.00018.49
8.1.30.0090.00018.59
8.1.20.0000.00818.59
8.1.10.0000.00818.50
8.1.00.0060.00318.38
8.0.300.0000.00821.03
8.0.290.0040.00417.63
8.0.280.0000.00919.44
8.0.270.0090.00019.00
8.0.260.0070.00017.70
8.0.250.0080.00317.77
8.0.240.0080.00017.79
8.0.230.0030.00317.79
8.0.220.0000.00717.56
8.0.210.0040.00417.78
8.0.200.0030.00317.76
8.0.190.0050.00317.84
8.0.180.0070.00017.71
8.0.170.0040.00417.62
8.0.160.0030.00717.82
8.0.150.0030.00517.73
8.0.140.0040.00417.75
8.0.130.0030.00313.46
8.0.120.0050.00317.67
8.0.110.0000.00717.93
8.0.100.0000.00717.81
8.0.90.0000.00717.82
8.0.80.0140.00217.86
8.0.70.0090.01117.89
8.0.60.0110.00817.88
8.0.50.0030.01417.85
8.0.30.0000.01817.76
8.0.20.0100.01017.96
8.0.10.0040.01817.91
8.0.00.0030.01217.80
7.4.330.0060.00016.84
7.4.320.0060.00017.48
7.4.300.0060.00017.39
7.4.290.0000.00717.34
7.4.280.0050.00317.27
7.4.270.0070.00017.48
7.4.260.0060.00313.21
7.4.250.0080.00017.49
7.4.240.0040.00417.42
7.4.230.0000.00717.58
7.4.220.0000.00717.32
7.4.210.0060.00917.40
7.4.200.0140.00317.32
7.4.190.0030.01217.55
7.4.180.0000.01517.49
7.4.160.0090.00617.36
7.4.150.0070.00717.50
7.4.140.0040.01117.30
7.4.130.0080.00817.15
7.4.120.0070.00717.35
7.4.110.0070.00717.29
7.4.100.0070.00717.45
7.4.90.0030.01317.44
7.4.80.0100.01017.31
7.4.70.0060.00917.38
7.4.60.0210.00017.27
7.4.50.0110.01117.06
7.4.40.0140.00717.16
7.4.30.0120.00317.18
7.4.20.0090.00617.42
7.4.10.0130.00717.37
7.4.00.0030.01017.32
7.3.330.0060.00617.17
7.3.320.0030.00313.01
7.3.310.0080.00017.16
7.3.300.0070.00017.02
7.3.290.0150.00417.17
7.3.280.0070.00717.19
7.3.270.0110.00417.21
7.3.260.0040.01117.31
7.3.250.0080.00817.11
7.3.240.0070.00717.19
7.3.230.0090.00617.07
7.3.220.0030.01017.10
7.3.210.0080.00817.07
7.3.200.0030.01017.10
7.3.190.0040.01116.82
7.3.180.0080.00517.13
7.3.170.0070.00716.97
7.3.160.0070.00717.11
7.3.150.0080.00517.04
7.3.140.0040.01117.07
7.3.130.0040.01016.93
7.3.120.0030.01017.10
7.3.110.0100.00317.01
7.3.100.0070.00716.98
7.3.90.0000.01517.49
7.3.80.0140.00017.07
7.3.70.0100.00717.30
7.3.60.0000.02117.25
7.3.50.0070.01417.25
7.3.40.0110.00417.30
7.3.30.0160.00317.23
7.3.20.0080.01117.20
7.3.10.0070.01017.13
7.3.00.0120.00317.13

preferences:
30.18 ms | 400 KiB | 5 Q