3v4l.org

run code in 300+ PHP versions simultaneously
<?php $color = "#ccc"; $color = substr($color,1); if (strlen($color) == 3) { $r = substr($color,0,1); $g = substr($color,1,1); $b = substr($color,2,1); } elseif (strlen($color) == 6) { $r = substr($color,0,2); $g = substr($color,2,2); $b = substr($color,4,2); } else { throw new Exception('Invalid color format'); } var_dump($r,$g,$b);

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.0180.00016.25
8.3.50.0100.00822.82
8.3.40.0000.01418.71
8.3.30.0070.00719.10
8.3.20.0080.00020.04
8.3.10.0030.00521.98
8.3.00.0080.00017.80
8.2.180.0120.00616.63
8.2.170.0070.00722.96
8.2.160.0100.00620.23
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0140.00426.16
8.2.120.0080.00021.02
8.2.110.0080.00320.97
8.2.100.0040.00817.78
8.2.90.0040.00417.72
8.2.80.0030.00517.97
8.2.70.0040.00417.38
8.2.60.0040.00817.68
8.2.50.0030.00918.07
8.2.40.0030.00518.03
8.2.30.0040.00418.01
8.2.20.0040.00417.68
8.2.10.0000.00717.93
8.2.00.0000.00717.55
8.1.280.0110.00725.92
8.1.270.0000.00823.82
8.1.260.0000.00726.35
8.1.250.0060.00328.09
8.1.240.0090.00022.61
8.1.230.0000.01120.97
8.1.220.0080.00017.74
8.1.210.0050.00319.10
8.1.200.0030.00617.35
8.1.190.0050.00317.13
8.1.180.0040.00418.10
8.1.170.0000.00818.59
8.1.160.0040.00422.00
8.1.150.0050.00318.92
8.1.140.0070.00017.45
8.1.130.0000.00717.72
8.1.120.0030.00417.43
8.1.110.0040.00417.44
8.1.100.0070.00017.35
8.1.90.0000.00717.49
8.1.80.0070.00017.45
8.1.70.0000.00717.44
8.1.60.0040.00417.49
8.1.50.0080.00017.51
8.1.40.0090.00017.42
8.1.30.0040.00417.65
8.1.20.0030.00517.63
8.1.10.0050.00217.57
8.1.00.0000.00817.40
8.0.300.0040.00419.84
8.0.290.0040.00416.63
8.0.280.0070.00018.36
8.0.270.0030.00317.06
8.0.260.0080.00017.13
8.0.250.0000.00716.76
8.0.240.0000.00816.89
8.0.230.0040.00416.93
8.0.220.0040.00416.74
8.0.210.0000.00616.86
8.0.200.0000.00716.88
8.0.190.0040.00416.72
8.0.180.0050.00316.77
8.0.170.0040.00416.82
8.0.160.0040.00416.80
8.0.150.0030.00316.72
8.0.140.0000.00916.68
8.0.130.0050.00013.24
8.0.120.0000.00816.71
8.0.110.0040.00416.86
8.0.100.0030.00616.77
8.0.90.0030.00516.92
8.0.80.0040.01216.90
8.0.70.0000.00716.90
8.0.60.0040.00416.88
8.0.50.0000.00716.77
8.0.30.0140.00417.22
8.0.20.0080.01117.40
8.0.10.0040.00417.02
8.0.00.0130.00416.84
7.4.330.0000.00515.13
7.4.320.0000.00616.41
7.4.300.0040.00416.60
7.4.290.0030.00316.47
7.4.280.0040.00416.56
7.4.270.0000.00716.50
7.4.260.0020.00516.47
7.4.250.0000.00716.57
7.4.240.0050.00216.47
7.4.230.0000.00716.58
7.4.220.0140.00316.49
7.4.210.0000.01416.61
7.4.200.0050.00216.39
7.4.160.0080.00816.59
7.4.150.0120.00917.40
7.4.140.0110.00517.86
7.4.130.0060.01016.44
7.4.120.0120.00516.44
7.4.110.0030.01316.55
7.4.100.0070.01116.64
7.4.90.0120.00916.40
7.4.80.0070.01019.39
7.4.70.0170.00316.66
7.4.60.0030.01416.50
7.4.50.0000.00416.49
7.4.40.0060.00916.30
7.4.30.0060.01216.68
7.4.00.0030.01315.01
7.3.330.0030.00313.19
7.3.320.0030.00213.10
7.3.310.0040.00416.31
7.3.300.0040.00416.11
7.3.290.0070.01416.30
7.3.280.0140.00616.25
7.3.270.0120.00617.40
7.3.260.0090.01216.20
7.3.250.0100.01316.49
7.3.240.0040.01416.21
7.3.230.0130.00316.61
7.3.210.0160.00316.55
7.3.200.0100.01019.39
7.3.190.0140.00616.36
7.3.180.0070.01016.34
7.3.170.0040.01116.30
7.3.160.0080.00816.32
7.3.120.0070.01014.98
7.2.330.0170.00016.39
7.2.320.0030.01316.41
7.2.310.0080.01016.75
7.2.300.0060.00916.48
7.2.290.0060.01116.64
7.2.60.0090.00316.92
7.2.50.0040.01116.92
7.1.200.0030.00815.72
7.1.100.0040.00718.08
7.1.70.0070.00717.03
7.1.60.0160.00919.40
7.1.50.0040.01116.63
7.1.00.0070.07022.44
7.0.200.0040.00816.48
7.0.140.0100.06321.95
7.0.60.0030.05019.91
7.0.50.0000.04717.80
7.0.40.0070.04320.04
7.0.30.0270.05020.31
7.0.20.0330.07320.16
7.0.10.0100.07320.16
7.0.00.0130.04320.12
5.6.280.0070.06721.10
5.6.210.0070.07320.46
5.6.200.0170.07018.08
5.6.190.0100.05320.57
5.6.180.0300.08020.35
5.6.170.0200.03720.49
5.6.160.0070.08320.61
5.6.150.0070.08318.24
5.6.140.0130.07718.12
5.6.130.0070.08018.21
5.6.120.0100.08021.11
5.6.110.0130.08020.97
5.6.100.0230.06721.03
5.6.90.0130.08021.00
5.6.80.0130.07020.40
5.5.350.0070.08020.46
5.5.340.0070.08017.92
5.5.330.0070.04020.43
5.5.320.0400.07320.18
5.5.310.0300.06720.29
5.5.300.0030.07317.91
5.5.290.0100.08017.98
5.5.280.0030.04320.87
5.5.270.0170.05720.72
5.5.260.0030.04320.67
5.5.250.0070.07020.61
5.5.240.0300.06320.26
5.4.450.0430.04319.26
5.4.440.1000.03719.41
5.4.430.0270.04319.57
5.4.420.0170.06019.41
5.4.410.1000.04319.11
5.4.400.0530.03018.91
5.4.390.0170.04319.09
5.4.380.0900.06718.71
5.4.370.0630.06018.52
5.4.360.0900.04018.68
5.4.350.0600.06318.57
5.4.340.1130.05318.56
5.4.320.0050.03912.46
5.4.310.0070.04012.45
5.4.300.0060.04412.45
5.4.290.0060.04212.45
5.4.280.0080.04012.35
5.4.270.0100.03612.35
5.4.260.0070.04712.35
5.4.250.0090.03812.35
5.4.240.0070.03712.35
5.4.230.0050.04112.34
5.4.220.0080.03512.34
5.4.210.0070.03612.34
5.4.200.0050.04012.34
5.4.190.0060.04012.34
5.4.180.0070.03512.34
5.4.170.0100.04012.35
5.4.160.0040.04212.35
5.4.150.0080.03712.34
5.4.140.0100.05412.02
5.4.130.0060.04012.01
5.4.120.0050.03711.97
5.4.110.0080.04011.96
5.4.100.0060.04511.97
5.4.90.0040.03811.97
5.4.80.0060.04111.97
5.4.70.0060.03611.96
5.4.60.0080.03211.96
5.4.50.0050.03811.96
5.4.40.0070.04111.95
5.4.30.0100.03711.95
5.4.20.0070.04511.95
5.4.10.0080.04011.95
5.4.00.0060.04111.44
5.3.290.0070.03812.80
5.3.280.0070.03712.70
5.3.270.0050.03912.73
5.3.260.0120.04012.72
5.3.250.0030.04812.72
5.3.240.0080.03712.72
5.3.230.0070.03712.71
5.3.220.0040.03912.68
5.3.210.0050.03912.68
5.3.200.0070.04012.68
5.3.190.0060.03912.68
5.3.180.0080.04112.67
5.3.170.0060.03812.67
5.3.160.0090.04112.68
5.3.150.0080.04412.67
5.3.140.0110.04012.66
5.3.130.0090.03712.66
5.3.120.0100.04112.65
5.3.110.0030.04112.65
5.3.100.0040.03912.12
5.3.90.0070.03512.08
5.3.80.0080.03912.07
5.3.70.0060.03812.07
5.3.60.0050.04612.06
5.3.50.0050.03812.00
5.3.40.0120.04212.00
5.3.30.0090.04011.94
5.3.20.0080.04511.73
5.3.10.0080.04111.69
5.3.00.0100.03311.68
5.2.170.0050.0319.18
5.2.160.0050.0299.18
5.2.150.0050.0319.18
5.2.140.0060.0299.17
5.2.130.0060.0289.14
5.2.120.0070.0269.14
5.2.110.0050.0279.14
5.2.100.0120.0329.14
5.2.90.0060.0289.14
5.2.80.0170.0299.13
5.2.70.0040.0339.13
5.2.60.0050.0339.09
5.2.50.0110.0279.05
5.2.40.0060.0289.03
5.2.30.0040.0359.01
5.2.20.0040.0319.00
5.2.10.0080.0348.92
5.2.00.0070.0358.78
5.1.60.0070.0268.07
5.1.50.0040.0268.06
5.1.40.0040.0258.04
5.1.30.0050.0338.39
5.1.20.0070.0348.41
5.1.10.0040.0328.14
5.1.00.0040.0298.14
5.0.50.0040.0226.63
5.0.40.0030.0236.48
5.0.30.0030.0326.30
5.0.20.0030.0226.27
5.0.10.0050.0236.25
5.0.00.0040.0326.24
4.4.90.0010.0224.78
4.4.80.0020.0164.75
4.4.70.0030.0144.75
4.4.60.0040.0154.76
4.4.50.0040.0164.77
4.4.40.0020.0274.71
4.4.30.0020.0174.76
4.4.20.0060.0134.84
4.4.10.0030.0164.85
4.4.00.0030.0254.76
4.3.110.0030.0174.67
4.3.100.0020.0174.66
4.3.90.0020.0154.63
4.3.80.0050.0284.59
4.3.70.0020.0234.63
4.3.60.0020.0154.63
4.3.50.0010.0174.63
4.3.40.0030.0234.54
4.3.30.0010.0173.29
4.3.20.0030.0153.26
4.3.10.0020.0173.23
4.3.00.0070.02015.17

preferences:
40.84 ms | 401 KiB | 5 Q