3v4l.org

run code in 300+ PHP versions simultaneously
<?php $number = '123456789'; $rest = substr($number, 0, 4); $rest2 = substr($number, 4,-1); $f = $rest.'-'.$rest2; echo $f;

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.00318.30
8.3.50.0120.00721.99
8.3.40.0070.00718.72
8.3.30.0100.00319.04
8.3.20.0050.00320.39
8.3.10.0050.00322.14
8.3.00.0050.00522.46
8.2.180.0140.00316.32
8.2.170.0070.01422.96
8.2.160.0140.00020.86
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0080.00017.75
8.2.110.0000.01120.38
8.2.100.0090.00317.84
8.2.90.0000.00919.26
8.2.80.0030.00617.97
8.2.70.0040.00417.63
8.2.60.0000.00917.93
8.2.50.0040.00418.10
8.2.40.0040.00418.22
8.2.30.0040.00418.16
8.2.20.0000.00817.58
8.2.10.0040.00419.60
8.2.00.0040.00417.79
8.1.280.0120.00625.92
8.1.270.0000.00822.24
8.1.260.0080.00026.35
8.1.250.0030.00628.09
8.1.240.0060.00322.19
8.1.230.0070.00317.55
8.1.220.0000.00817.74
8.1.210.0050.00318.77
8.1.200.0000.01017.35
8.1.190.0030.00617.22
8.1.180.0040.00418.10
8.1.170.0040.00418.64
8.1.160.0040.00421.97
8.1.150.0040.00418.63
8.1.140.0030.00517.38
8.1.130.0000.00717.70
8.1.120.0030.00617.42
8.1.110.0000.00717.45
8.1.100.0070.00017.43
8.1.90.0080.00017.41
8.1.80.0000.00717.44
8.1.70.0050.00217.39
8.1.60.0000.01017.55
8.1.50.0040.00417.47
8.1.40.0080.00017.52
8.1.30.0040.00417.54
8.1.20.0040.00417.63
8.1.10.0040.00417.52
8.1.00.0050.00317.50
8.0.300.0090.00019.81
8.0.290.0040.00416.75
8.0.280.0030.00318.50
8.0.270.0000.00717.25
8.0.260.0060.00016.84
8.0.250.0030.00316.91
8.0.240.0040.00416.95
8.0.230.0050.00217.03
8.0.220.0030.00316.91
8.0.210.0070.00016.88
8.0.200.0030.00316.99
8.0.190.0050.00216.85
8.0.180.0070.00016.79
8.0.170.0040.00416.93
8.0.160.0070.00016.88
8.0.150.0070.00016.92
8.0.140.0050.00316.88
8.0.130.0000.00513.34
8.0.120.0000.00816.86
8.0.110.0070.00016.91
8.0.100.0030.00416.88
8.0.90.0040.00416.84
8.0.80.0100.00616.92
8.0.70.0040.00416.92
8.0.60.0050.00316.93
8.0.50.0070.00016.85
8.0.30.0050.01716.94
8.0.20.0150.00317.40
8.0.10.0070.00016.74
8.0.00.0110.00616.83
7.4.330.0050.00015.07
7.4.320.0020.00516.40
7.4.300.0040.00416.65
7.4.290.0040.00416.51
7.4.280.0040.00416.39
7.4.270.0030.00516.47
7.4.260.0060.00316.50
7.4.250.0020.00516.46
7.4.240.0050.00316.52
7.4.230.0030.00316.55
7.4.220.0040.01816.52
7.4.210.0100.00616.47
7.4.200.0040.00416.42
7.4.190.0070.00016.51
7.4.160.0120.00416.32
7.4.150.0070.01017.40
7.4.140.0080.01117.86
7.4.130.0070.01016.50
7.4.120.0100.00716.47
7.4.110.0090.01216.48
7.4.100.0100.00716.38
7.4.90.0120.01216.34
7.4.80.0180.00419.39
7.4.70.0150.00316.58
7.4.60.0070.01016.30
7.4.50.0040.00416.26
7.4.40.0040.01122.77
7.4.30.0110.00516.34
7.4.00.0100.00714.89
7.3.330.0000.00613.11
7.3.320.0000.00513.05
7.3.310.0090.00016.26
7.3.300.0000.00616.24
7.3.290.0000.01516.21
7.3.280.0120.00816.24
7.3.270.0130.00317.40
7.3.260.0040.01416.56
7.3.250.0140.00616.33
7.3.240.0070.01016.27
7.3.230.0100.00616.39
7.3.210.0160.00616.42
7.3.200.0130.01019.39
7.3.190.0150.00316.15
7.3.180.0100.00616.25
7.3.170.0100.00716.36
7.3.160.0070.01016.41
7.3.120.0060.00915.00
7.2.330.0130.00916.57
7.2.320.0030.01616.76
7.2.310.0160.00616.73
7.2.300.0150.00816.64
7.2.290.0130.00416.48
7.2.60.0070.00716.66
7.2.00.0100.00019.55
7.1.200.0060.00615.84
7.1.100.0060.00618.16
7.1.70.0000.01417.27
7.1.60.0100.01619.82
7.1.50.0170.00716.98
7.1.00.0030.07322.31
7.0.200.0170.00616.66
7.0.140.0030.07722.07
7.0.60.0100.04319.93
7.0.50.0100.06717.78
7.0.40.0130.06319.90
7.0.30.0400.05320.28
7.0.20.0330.08020.33
7.0.10.0200.07320.21
7.0.00.0130.07720.08
5.6.280.0000.07721.06
5.6.210.0030.08020.48
5.6.200.0130.03018.21
5.6.190.0100.08320.39
5.6.180.0130.06320.77
5.6.170.0200.05720.49
5.6.160.0100.04320.45
5.6.150.0070.08318.16
5.6.140.0000.04718.21
5.6.130.0100.08318.18
5.6.120.0070.05720.98
5.6.110.0130.07321.02
5.6.100.0100.08721.01
5.6.90.0170.05720.96
5.6.80.0000.04020.50
5.6.70.3500.04020.37
5.5.350.0170.05020.31
5.5.340.0030.08317.95
5.5.330.0070.04320.36
5.5.320.0030.07020.18
5.5.310.0200.07320.34
5.5.300.0030.04017.91
5.5.290.0070.08017.98
5.5.280.0030.08720.97
5.5.270.0100.07320.86
5.5.260.0130.06020.75
5.5.250.0000.09320.60
5.5.240.0200.06320.25
5.4.450.0870.07319.48
5.4.440.0130.06019.49
5.4.430.0130.05019.50
5.4.420.0170.05319.49
5.4.410.0000.06318.96
5.4.400.0000.06018.62
5.4.390.0030.06018.67
5.4.380.0170.05018.57
5.4.370.0130.06018.78
5.4.360.0630.05318.55
5.4.350.0100.06018.73
5.4.340.0070.05318.71
5.4.320.0070.03712.45
5.4.310.0090.04112.45
5.4.300.0090.03412.45
5.4.290.0080.03612.45
5.4.280.0060.03812.34
5.4.270.0230.05718.89
5.4.260.0130.06718.72
5.4.250.0130.05318.70
5.4.240.0170.05318.99
5.4.230.0170.07018.77
5.4.220.0130.05718.99
5.4.210.0130.05018.87
5.4.200.0200.04318.83
5.4.190.0100.07718.70
5.4.180.0200.06319.02
5.4.170.0170.06318.70
5.4.160.0070.05318.93
5.4.150.0130.07318.71
5.4.140.0100.06316.26
5.4.130.0070.05016.28
5.4.120.0100.05016.19
5.4.110.0070.05016.20
5.4.100.0100.04716.42
5.4.90.0200.04016.42
5.4.80.0070.05716.44
5.4.70.0070.07716.51
5.4.60.0200.04316.50
5.4.50.0100.05016.36
5.4.40.0170.05316.31
5.4.30.0030.06716.20
5.4.20.0070.06316.36
5.4.10.0200.06016.48
5.4.00.0200.05015.69
5.3.290.0060.03912.80
5.3.280.0070.05714.45
5.3.270.0030.05714.46
5.3.260.0200.04014.46
5.3.250.0030.08014.61
5.3.240.0070.06014.65
5.3.230.0100.06714.46
5.3.220.0100.04714.61
5.3.210.0170.06314.26
5.3.200.0100.04714.71
5.3.190.0170.04714.61
5.3.180.0070.05714.58
5.3.170.0100.06714.44
5.3.160.0100.05314.58
5.3.150.0070.07014.71
5.3.140.0130.05314.59
5.3.130.0130.07314.54
5.3.120.0070.05714.43
5.3.110.0200.07014.31
5.3.100.0100.06013.87
5.3.90.0100.04713.85
5.3.80.0070.05013.96
5.3.70.0100.05013.87
5.3.60.0070.05314.15
5.3.50.0130.06713.99
5.3.40.0170.04313.72
5.3.30.0100.05013.68
5.3.20.0130.06313.71
5.3.10.0100.06013.50
5.3.00.0130.06313.73
5.2.170.0070.04011.02
5.2.160.0070.05011.14
5.2.150.0130.04011.15
5.2.140.0070.04711.25
5.2.130.0070.04311.21
5.2.120.0070.04310.86
5.2.110.0070.05311.00
5.2.100.0130.03011.11
5.2.90.0070.04311.04
5.2.80.0070.05710.85
5.2.70.0030.04311.09
5.2.60.0100.04010.95
5.2.50.0130.03311.03
5.2.40.0100.04711.00
5.2.30.0030.06010.90
5.2.20.0100.04010.79
5.2.10.0070.03710.94
5.2.00.0130.04010.55
5.1.60.0070.03010.05
5.1.50.0130.04010.14
5.1.40.0100.0439.88
5.1.30.0030.03710.37
5.1.20.0100.03710.28
5.1.10.0070.03310.12
5.1.00.0130.0339.95
5.0.50.0030.0378.45
5.0.40.0070.0238.60
5.0.30.0000.0438.11
5.0.20.0030.0278.15
5.0.10.0030.0278.16
5.0.00.0070.0478.17
4.4.90.0100.0176.91
4.4.80.0070.0176.92
4.4.70.0030.0206.96
4.4.60.0070.0306.96
4.4.50.0200.0136.96
4.4.40.0030.0336.96
4.4.30.0070.0236.96
4.4.20.0070.0306.96
4.4.10.0070.0176.96
4.4.00.0030.0406.96
4.3.110.0000.0236.96
4.3.100.0000.0236.96
4.3.90.0000.0236.96
4.3.80.0100.0306.96
4.3.70.0100.0206.96
4.3.60.0030.0276.96
4.3.50.0000.0236.96
4.3.40.0030.0336.96
4.3.30.0000.0276.96
4.3.20.0000.0236.96
4.3.10.0000.0236.96
4.3.00.0130.0206.95

preferences:
43.97 ms | 401 KiB | 5 Q