3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sub_string($string, $start, $length) { $result = substr($string,$start,$length); return $result; } $test_string = '1978-02-16'; $year = sub_string($test_string,0,4); echo $year."\r\n"; $month = sub_string($test_string,5,2); echo $month."\r\n"; $day = sub_string($test_string,8,2); echo $day."\r\n";

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.0060.00918.27
8.3.50.0090.00822.01
8.3.40.0110.00718.68
8.3.30.0030.01018.82
8.3.20.0040.00420.18
8.3.10.0040.00421.94
8.3.00.0040.00417.77
8.2.180.0080.01116.32
8.2.170.0070.00722.96
8.2.160.0110.00320.49
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0110.00426.16
8.2.120.0040.00421.03
8.2.110.0070.00421.11
8.2.100.0120.00018.03
8.2.90.0030.00519.22
8.2.80.0030.00517.97
8.2.70.0080.00017.63
8.2.60.0080.00018.03
8.2.50.0000.00818.07
8.2.40.0110.00018.22
8.2.30.0000.00718.07
8.2.20.0040.00417.71
8.2.10.0040.00418.02
8.2.00.0000.00817.73
8.1.280.0040.01125.92
8.1.270.0060.00323.96
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0070.00321.29
8.1.230.0000.01119.55
8.1.220.0000.00817.76
8.1.210.0040.00418.77
8.1.200.0060.00317.38
8.1.190.0050.00317.22
8.1.180.0050.00318.10
8.1.170.0100.00018.45
8.1.160.0070.00021.95
8.1.150.0040.00418.80
8.1.140.0070.00017.46
8.1.130.0000.00717.70
8.1.120.0030.00317.45
8.1.110.0050.00317.30
8.1.100.0000.00717.39
8.1.90.0030.00617.35
8.1.80.0000.00717.39
8.1.70.0070.00017.29
8.1.60.0060.00317.59
8.1.50.0080.00017.51
8.1.40.0080.00017.41
8.1.30.0000.00817.60
8.1.20.0000.00717.64
8.1.10.0030.00617.52
8.1.00.0080.00017.46
8.0.300.0080.00018.77
8.0.290.0040.00416.75
8.0.280.0000.00818.32
8.0.270.0030.00317.18
8.0.260.0000.00617.19
8.0.250.0030.00316.87
8.0.240.0000.00917.02
8.0.230.0000.00716.92
8.0.220.0030.00316.85
8.0.210.0070.00016.75
8.0.200.0000.00716.84
8.0.190.0070.00016.91
8.0.180.0000.00816.76
8.0.170.0000.00816.88
8.0.160.0000.00817.02
8.0.150.0000.00716.88
8.0.140.0050.00216.81
8.0.130.0000.00613.25
8.0.120.0000.00816.91
8.0.110.0040.00416.89
8.0.100.0000.00716.84
8.0.90.0070.00016.79
8.0.80.0070.01716.95
8.0.70.0000.00716.89
8.0.60.0040.00416.88
8.0.50.0000.00716.96
8.0.30.0090.01117.12
8.0.20.0120.00717.40
8.0.10.0050.00316.78
8.0.00.0120.00816.86
7.4.330.0000.00615.00
7.4.320.0060.00016.52
7.4.300.0030.00316.50
7.4.290.0070.00016.47
7.4.280.0030.00616.54
7.4.270.0060.00316.55
7.4.260.0030.00316.56
7.4.250.0040.00416.57
7.4.240.0000.00716.53
7.4.230.0070.00016.61
7.4.220.0100.00716.53
7.4.210.0080.01116.70
7.4.200.0040.00416.66
7.4.160.0110.00916.39
7.4.150.0180.00617.40
7.4.140.0070.00917.86
7.4.130.0050.01216.49
7.4.120.0110.00816.42
7.4.110.0070.01016.66
7.4.100.0060.01216.51
7.4.90.0100.00716.70
7.4.80.0110.00719.39
7.4.70.0120.00616.74
7.4.60.0060.01516.55
7.4.50.0000.00516.25
7.4.40.0080.00816.57
7.4.30.0100.00716.73
7.4.00.0040.01515.21
7.3.330.0020.00313.23
7.3.320.0000.00513.25
7.3.310.0000.00716.16
7.3.300.0020.00516.35
7.3.290.0110.00316.32
7.3.280.0120.00616.33
7.3.270.0100.00717.40
7.3.260.0130.00316.30
7.3.250.0140.00316.29
7.3.240.0100.01316.44
7.3.230.0100.00616.39
7.3.210.0050.01116.48
7.3.200.0120.00919.39
7.3.190.0060.01016.49
7.3.180.0120.00416.33
7.3.170.0080.00816.64
7.3.160.0030.01716.28
7.2.330.0120.01216.66
7.2.320.0130.01016.85
7.2.310.0130.00316.67
7.2.300.0120.01216.50
7.2.290.0060.01016.54
7.2.00.0070.01419.30
7.1.100.0090.00917.99
7.1.70.0000.00817.02
7.1.60.0100.01019.40
7.1.50.0100.00316.91
7.1.00.0030.07322.37
7.0.200.0000.00916.89
7.0.140.0000.06322.00
7.0.60.0130.07719.80
7.0.50.0070.07717.73
7.0.40.0030.05020.14
7.0.30.0400.06720.19
7.0.20.0230.04720.20
7.0.10.0030.05720.19
7.0.00.0100.06720.30
5.6.280.0070.07321.03
5.6.210.0130.07320.61
5.6.200.0100.05318.15
5.6.190.0000.05020.54
5.6.180.0400.07320.34
5.6.170.0270.08020.51
5.6.160.0130.05320.39
5.6.150.0030.05718.18
5.6.140.0070.03718.17
5.6.130.0170.07018.11
5.6.120.0200.06321.14
5.6.110.0100.08321.10
5.6.100.0070.05721.12
5.6.90.0100.08020.98
5.6.80.0230.06720.50
5.5.350.2430.03720.44
5.5.340.0100.07718.09
5.5.330.0030.08320.46
5.5.320.0200.05720.31
5.5.310.0100.05020.38
5.5.300.0100.07718.04
5.5.290.0100.07717.95
5.5.280.0070.06720.89
5.5.270.0130.08020.98
5.5.260.0170.06020.64
5.5.250.0100.08020.69
5.5.240.0300.07020.12
5.4.450.0070.04319.59
5.4.440.0030.05019.42
5.4.430.0030.08319.16
5.4.420.0030.06019.27
5.4.410.0070.04019.50
5.4.400.0030.06318.95
5.4.390.0070.07319.21
5.4.380.0000.05319.19
5.4.370.0000.07719.09
5.4.360.0070.07319.15
5.4.350.0070.07019.08
5.4.340.0070.04018.84
5.4.320.0030.05019.06
5.4.310.0070.06719.13
5.4.300.0070.07719.30
5.4.290.0070.05319.05
5.4.280.0030.04718.95
5.4.270.0000.06319.20
5.4.260.0070.04019.23
5.4.250.0100.07719.22
5.4.240.0070.06719.18
5.4.230.0070.03319.09
5.4.220.0130.03719.13
5.4.210.0030.03718.86
5.4.200.0100.06319.16
5.4.190.0200.05018.86
5.4.180.0100.06719.22
5.4.170.0030.04019.11
5.4.160.0030.05319.14
5.4.150.0070.03719.20
5.4.140.0070.06716.49
5.4.130.0030.05316.41
5.4.120.0000.04716.34
5.4.110.0000.04316.56
5.4.100.0030.04016.36
5.4.90.0030.03316.59
5.4.80.0070.03716.49
5.4.70.0030.07016.50
5.4.60.0000.07316.43
5.4.50.0000.05316.51
5.4.40.0030.03716.22
5.4.30.0030.03716.43
5.4.20.0000.04716.25
5.4.10.0030.06316.32
5.4.00.0030.04315.76
5.3.290.0030.04014.67
5.3.280.0130.03314.68
5.3.270.0070.03714.62
5.3.260.0000.04014.58
5.3.250.0000.04314.71
5.3.240.0070.05314.61
5.3.230.0030.04014.52
5.3.220.0000.07714.54
5.3.210.0030.05314.53
5.3.200.0030.04014.79
5.3.190.0030.07014.65
5.3.180.0070.06714.64
5.3.170.0000.04014.55
5.3.160.0000.04014.46
5.3.150.0000.03714.48
5.3.140.0030.03314.53
5.3.130.0000.04014.52
5.3.120.0070.03314.55
5.3.110.0000.04014.45
5.3.100.0000.03714.01
5.3.90.0000.05014.24
5.3.80.0130.03013.91
5.3.70.0030.03314.09
5.3.60.0030.04314.12
5.3.50.0000.03713.96
5.3.40.0070.06013.85
5.3.30.0030.04713.98
5.3.20.0030.05713.70
5.3.10.0030.05013.80
5.3.00.0030.03313.65
5.2.170.0000.03312.33
5.2.160.0000.03312.33
5.2.150.0030.06012.33
5.2.140.0030.03712.33
5.2.130.0030.05312.33
5.2.120.0030.03312.33
5.2.110.0070.02712.33
5.2.100.0070.05012.33
5.2.90.0000.04012.33
5.2.80.0000.06312.33
5.2.70.0000.04312.33
5.2.60.0030.05012.33
5.2.50.0000.06312.33
5.2.40.0030.04012.33
5.2.30.0070.02712.33
5.2.20.0030.06012.33
5.2.10.0030.04012.33
5.2.00.0030.05312.33
5.1.60.0030.03712.33
5.1.50.0030.02712.33
5.1.40.0000.03012.33
5.1.30.0000.06012.33
5.1.20.0070.02712.33
5.1.10.0000.02712.33
5.1.00.0030.04012.33
5.0.50.0030.03312.33
5.0.40.0030.02012.33
5.0.30.0000.03312.33
5.0.20.0030.02012.33
5.0.10.0000.03712.33
5.0.00.0100.03712.33
4.4.90.0030.03312.33
4.4.80.0030.03712.33
4.4.70.0030.03012.33
4.4.60.0000.02012.33
4.4.50.0000.03312.33
4.4.40.0030.04712.33
4.4.30.0000.02012.33
4.4.20.0030.03712.33
4.4.10.0000.03712.33
4.4.00.0000.03012.33
4.3.110.0000.02012.33
4.3.100.0070.01312.33
4.3.90.0030.03312.33
4.3.80.0000.03712.33
4.3.70.0000.01712.33
4.3.60.0000.01712.33
4.3.50.0000.01712.33
4.3.40.0030.02312.33
4.3.30.0030.01712.33
4.3.20.0030.03012.33
4.3.10.0000.02012.33
4.3.00.0000.01712.33

preferences:
55.61 ms | 401 KiB | 5 Q