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);

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.00716.75
8.3.50.0150.00422.85
8.3.40.0090.00618.71
8.3.30.0000.01518.89
8.3.20.0040.00420.34
8.3.10.0070.00021.94
8.3.00.0080.00017.80
8.2.180.0180.00016.50
8.2.170.0070.00722.96
8.2.160.0030.01020.41
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0120.00326.16
8.2.120.0040.00421.06
8.2.110.0090.00020.35
8.2.100.0110.00019.35
8.2.90.0040.00419.09
8.2.80.0030.00617.97
8.2.70.0030.00617.36
8.2.60.0040.00417.92
8.2.50.0050.00318.07
8.2.40.0090.00018.03
8.2.30.0080.00017.88
8.2.20.0030.00617.50
8.2.10.0000.00718.06
8.2.00.0000.00717.67
8.1.280.0110.00425.92
8.1.270.0000.00823.94
8.1.260.0000.00826.35
8.1.250.0000.00928.09
8.1.240.0090.00023.88
8.1.230.0050.00518.99
8.1.220.0040.00417.74
8.1.210.0000.00918.77
8.1.200.0090.00017.35
8.1.190.0000.00817.10
8.1.180.0000.00718.10
8.1.170.0110.00518.22
8.1.160.0000.00721.99
8.1.150.0040.00418.80
8.1.140.0070.00017.39
8.1.130.0000.00717.73
8.1.120.0040.00417.40
8.1.110.0030.00617.46
8.1.100.0040.00417.29
8.1.90.0100.00017.36
8.1.80.0030.00617.37
8.1.70.0030.00517.38
8.1.60.0040.00417.54
8.1.50.0030.00617.50
8.1.40.0040.00417.42
8.1.30.0030.00617.52
8.1.20.0000.00717.53
8.1.10.0000.00717.38
8.1.00.0030.00517.37
8.0.300.0070.00018.77
8.0.290.0070.00016.63
8.0.280.0000.00818.30
8.0.270.0000.00717.07
8.0.260.0030.00317.20
8.0.250.0030.00316.96
8.0.240.0000.00816.77
8.0.230.0080.00016.91
8.0.220.0030.00316.81
8.0.210.0070.00016.67
8.0.200.0000.00716.86
8.0.190.0060.00316.79
8.0.180.0070.00016.84
8.0.170.0040.00416.79
8.0.160.0050.00316.88
8.0.150.0040.00416.67
8.0.140.0070.00016.68
8.0.130.0000.00613.23
8.0.120.0040.00416.73
8.0.110.0000.00716.71
8.0.100.0000.00716.79
8.0.90.0000.00716.73
8.0.80.0120.01116.72
8.0.70.0050.00216.87
8.0.60.0000.00716.67
8.0.50.0040.00416.79
8.0.30.0120.00717.02
8.0.20.0080.01117.40
8.0.10.0000.00717.05
8.0.00.0100.01016.86
7.4.330.0060.00015.00
7.4.320.0030.00316.52
7.4.300.0060.00016.49
7.4.290.0030.00316.59
7.4.280.0040.00416.64
7.4.270.0000.00716.61
7.4.260.0030.00316.39
7.4.250.0030.00316.55
7.4.240.0050.00216.57
7.4.230.0000.00716.67
7.4.220.0110.01116.53
7.4.210.0040.01116.47
7.4.200.0030.00316.64
7.4.160.0040.01216.48
7.4.150.0090.01217.40
7.4.140.0080.00817.86
7.4.130.0090.00916.41
7.4.120.0090.01016.53
7.4.110.0070.01016.52
7.4.100.0100.00716.47
7.4.90.0120.00616.38
7.4.80.0120.00619.39
7.4.70.0030.01816.30
7.4.60.0070.01416.46
7.4.50.0000.00416.59
7.4.40.0100.01016.52
7.4.30.0110.00616.43
7.4.00.0100.00814.99
7.3.330.0030.00313.31
7.3.320.0030.00313.22
7.3.310.0070.00016.06
7.3.300.0000.00616.11
7.3.290.0100.00316.25
7.3.280.0080.00916.22
7.3.270.0090.00917.40
7.3.260.0070.01016.52
7.3.250.0110.00616.27
7.3.240.0100.00716.18
7.3.230.0060.01116.39
7.3.210.0150.00316.25
7.3.200.0120.01219.39
7.3.190.0040.01216.41
7.3.180.0080.00816.29
7.3.170.0060.01016.27
7.3.160.0130.00916.28
7.3.120.0070.01014.87
7.3.110.0120.00514.63
7.3.100.0050.01314.75
7.3.90.0050.00814.59
7.3.80.0030.01114.74
7.3.70.0070.00614.65
7.3.60.0060.00614.70
7.3.50.0100.00814.88
7.3.40.0070.00914.59
7.3.30.0070.00614.78
7.3.20.0060.00416.50
7.3.10.0060.00716.54
7.3.00.0030.00816.44
7.2.330.0100.00716.63
7.2.320.0060.01316.64
7.2.310.0130.00316.74
7.2.300.0060.00916.73
7.2.290.0130.00316.28
7.2.250.0080.01014.79
7.2.240.0060.01114.78
7.2.230.0060.01014.88
7.2.220.0090.00814.78
7.2.210.0020.01314.79
7.2.200.0060.00914.86
7.2.190.0050.00914.90
7.2.180.0070.01015.06
7.2.170.0030.01114.92
7.2.00.0200.00619.29
7.1.330.0070.00715.47
7.1.320.0040.01115.90
7.1.310.0070.01015.71
7.1.300.0040.00915.77
7.1.290.0090.00315.63
7.1.280.0050.00615.61
7.1.270.0080.00715.63
7.1.260.0060.00715.71
7.1.100.0110.00717.96
7.1.70.0000.00917.05
7.1.60.0000.01519.40
7.1.50.0150.00016.95
7.1.00.0070.07322.44
7.0.200.0000.00816.56
7.0.140.0000.05022.09
7.0.60.0070.07720.07
7.0.50.0030.07717.82
7.0.40.0030.09320.02
7.0.30.0300.04320.25
7.0.20.0200.05720.24
7.0.10.0100.08320.12
7.0.00.0030.06720.23
5.6.280.0030.07320.82
5.6.210.0000.04320.55
5.6.200.0030.07318.24
5.6.190.0030.07720.39
5.6.180.3770.04320.40
5.6.170.0300.04320.62
5.6.160.0100.05720.57
5.6.150.0030.04018.20
5.6.140.0070.07318.21
5.6.130.0030.04018.13
5.6.120.0100.04321.15
5.6.110.0070.08321.14
5.6.100.0030.05721.11
5.6.90.0030.09320.95
5.6.80.0170.07320.52
5.5.350.0100.03720.33
5.5.340.0070.04717.92
5.5.330.0030.04720.25
5.5.320.2200.04720.30
5.5.310.0270.04020.27
5.5.300.0130.04318.04
5.5.290.0030.04018.08
5.5.280.0100.08320.73
5.5.270.0100.06320.77
5.5.260.0070.07020.68
5.5.250.0030.04320.67
5.5.240.3400.02320.23
5.4.450.0300.04019.31
5.4.440.0270.04319.50
5.4.430.0400.04019.63
5.4.420.0330.04019.16
5.4.410.0500.03719.42
5.4.400.0200.03319.00
5.4.390.0470.05018.89
5.4.380.0400.08318.59
5.4.370.0100.05718.75
5.4.360.0300.05718.61
5.4.350.0300.04718.56
5.4.340.0400.05718.56
5.4.320.0060.04512.50
5.4.310.0070.03812.50
5.4.300.0050.03812.50
5.4.290.0080.03612.50
5.4.280.0040.03912.39
5.4.270.0070.03612.40
5.4.260.0070.03612.40
5.4.250.0080.03612.39
5.4.240.0080.05412.40
5.4.230.0100.05112.39
5.4.220.0130.05612.39
5.4.210.0050.05212.39
5.4.200.0040.04212.39
5.4.190.0100.03812.39
5.4.180.0050.03912.39
5.4.170.0070.03612.40
5.4.160.0120.03412.39
5.4.150.0030.04012.39
5.4.140.0060.05212.07
5.4.130.0070.03812.05
5.4.120.0110.04412.02
5.4.110.0050.03612.01
5.4.100.0080.03312.01
5.4.90.0060.03912.01
5.4.80.0130.03712.02
5.4.70.0050.03712.00
5.4.60.0080.04012.01
5.4.50.0060.05212.01
5.4.40.0110.04512.00
5.4.30.0110.04511.99
5.4.20.0040.03811.99
5.4.10.0050.03711.99
5.4.00.0080.03611.48
5.3.290.0080.05512.80
5.3.280.0030.04412.70
5.3.270.0090.04612.73
5.3.260.0150.05912.71
5.3.250.0080.03812.72
5.3.240.0070.03712.72
5.3.230.0100.04412.70
5.3.220.0040.03912.68
5.3.210.0030.04212.68
5.3.200.0030.03912.68
5.3.190.0070.04112.68
5.3.180.0110.04012.67
5.3.170.0070.04112.67
5.3.160.0120.05012.68
5.3.150.0040.04412.68
5.3.140.0100.03812.66
5.3.130.0080.04212.66
5.3.120.0050.03912.65
5.3.110.0060.03712.66
5.3.100.0060.03812.12
5.3.90.0040.03912.10
5.3.80.0060.03612.09
5.3.70.0090.03412.09
5.3.60.0070.03612.07
5.3.50.0070.03512.02
5.3.40.0060.03812.02
5.3.30.0070.03511.97
5.3.20.0050.03711.76
5.3.10.0030.03811.73
5.3.00.0070.04511.71
5.2.170.0060.0319.22
5.2.160.0040.0319.21
5.2.150.0090.0279.22
5.2.140.0040.0319.21
5.2.130.0070.0279.17
5.2.120.0080.0249.18
5.2.110.0040.0299.18
5.2.100.0040.0289.17
5.2.90.0050.0289.17
5.2.80.0050.0309.17
5.2.70.0070.0299.17
5.2.60.0050.0309.13
5.2.50.0010.0349.10
5.2.40.0060.0309.07
5.2.30.0060.0289.04
5.2.20.0030.0309.03
5.2.10.0060.0278.94
5.2.00.0050.0318.79
5.1.60.0040.0278.09
5.1.50.0050.0258.09
5.1.40.0040.0278.06
5.1.30.0030.0278.41
5.1.20.0040.0278.43
5.1.10.0070.0268.16
5.1.00.0050.0288.16
5.0.50.0040.0256.63
5.0.40.0050.0206.50
5.0.30.0080.0516.30
5.0.20.0030.0256.27
5.0.10.0030.0266.26
5.0.00.0060.0296.25
4.4.90.0050.0174.78
4.4.80.0030.0164.76
4.4.70.0010.0184.76
4.4.60.0020.0234.76
4.4.50.0040.0214.77
4.4.40.0010.0274.71
4.4.30.0040.0214.76
4.4.20.0030.0154.84
4.4.10.0050.0154.85
4.4.00.0030.0254.76
4.3.110.0040.0144.66
4.3.100.0040.0134.67
4.3.90.0030.0144.63
4.3.80.0000.0274.58
4.3.70.0010.0164.63
4.3.60.0050.0134.63
4.3.50.0070.0114.63
4.3.40.0020.0244.54
4.3.30.0020.0163.30
4.3.20.0000.0193.28
4.3.10.0020.0163.24
4.3.00.0100.01315.89

preferences:
44.54 ms | 401 KiB | 5 Q