3v4l.org

run code in 300+ PHP versions simultaneously
<?php $color = "#a1c2bb"; $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.0150.00316.75
8.3.50.0100.00522.84
8.3.40.0120.00318.65
8.3.30.0140.00019.06
8.3.20.0000.00720.22
8.3.10.0080.00021.90
8.3.00.0080.00017.80
8.2.180.0120.00616.38
8.2.170.0140.00022.96
8.2.160.0100.00320.47
8.2.150.0090.00024.18
8.2.140.0030.00624.66
8.2.130.0150.00326.16
8.2.120.0000.00820.99
8.2.110.0030.00722.11
8.2.100.0040.00817.72
8.2.90.0050.00219.05
8.2.80.0050.00317.97
8.2.70.0030.00517.63
8.2.60.0060.00617.80
8.2.50.0070.00218.07
8.2.40.0080.00018.03
8.2.30.0030.00518.05
8.2.20.0000.00817.49
8.2.10.0000.00717.96
8.2.00.0030.00517.60
8.1.280.0090.00625.92
8.1.270.0040.00423.96
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0070.00323.79
8.1.230.0080.00419.17
8.1.220.0030.00517.74
8.1.210.0030.00618.77
8.1.200.0030.00617.23
8.1.190.0000.00817.09
8.1.180.0070.00018.10
8.1.170.0040.00418.44
8.1.160.0000.00721.91
8.1.150.0040.00418.91
8.1.140.0030.00517.48
8.1.130.0000.00717.76
8.1.120.0050.00317.39
8.1.110.0040.00417.44
8.1.100.0040.00417.35
8.1.90.0000.00717.37
8.1.80.0040.00417.47
8.1.70.0000.00717.47
8.1.60.0050.00317.60
8.1.50.0060.00317.45
8.1.40.0000.00817.50
8.1.30.0030.00517.64
8.1.20.0040.00417.69
8.1.10.0000.00817.40
8.1.00.0040.00417.33
8.0.300.0040.00418.77
8.0.290.0000.00716.63
8.0.280.0030.00318.43
8.0.270.0030.00317.20
8.0.260.0000.00717.30
8.0.250.0000.00716.87
8.0.240.0080.00016.88
8.0.230.0040.00416.79
8.0.220.0030.00316.78
8.0.210.0030.00316.88
8.0.200.0000.00816.87
8.0.190.0040.00416.92
8.0.180.0000.00816.84
8.0.170.0050.00316.84
8.0.160.0080.00016.72
8.0.150.0000.00716.65
8.0.140.0100.00016.84
8.0.130.0050.00013.18
8.0.120.0040.00416.66
8.0.110.0070.00016.89
8.0.100.0000.00716.79
8.0.90.0050.00316.93
8.0.80.0030.01316.80
8.0.70.0040.00416.76
8.0.60.0000.00716.90
8.0.50.0000.00716.77
8.0.30.0100.01217.14
8.0.20.0120.00817.40
8.0.10.0040.00416.85
8.0.00.0050.01316.78
7.4.330.0050.00015.05
7.4.320.0030.00316.62
7.4.300.0030.00316.62
7.4.290.0030.00316.39
7.4.280.0060.00316.52
7.4.270.0060.00316.64
7.4.260.0040.00416.48
7.4.250.0070.00016.56
7.4.240.0040.00416.56
7.4.230.0000.00716.57
7.4.220.0070.01016.52
7.4.210.0090.00916.58
7.4.200.0070.00016.50
7.4.160.0030.01416.47
7.4.150.0150.00317.40
7.4.140.0130.00517.86
7.4.130.0110.00816.47
7.4.120.0080.00916.51
7.4.110.0070.01116.48
7.4.100.0070.01016.36
7.4.90.0140.00316.45
7.4.80.0110.00719.39
7.4.70.0140.00316.62
7.4.60.0030.01316.54
7.4.50.0000.00416.30
7.4.40.0000.01916.44
7.4.30.0060.01616.60
7.4.00.0030.01414.86
7.3.330.0070.00013.13
7.3.320.0020.00213.15
7.3.310.0070.00016.34
7.3.300.0030.00316.25
7.3.290.0030.01016.20
7.3.280.0070.00916.27
7.3.270.0060.01217.40
7.3.260.0120.00416.59
7.3.250.0190.00316.54
7.3.240.0130.00716.36
7.3.230.0070.01116.39
7.3.210.0080.00816.56
7.3.200.0090.00919.39
7.3.190.0100.00716.52
7.3.180.0080.00816.58
7.3.170.0100.00716.39
7.3.160.0090.00616.47
7.3.120.0090.00914.52
7.3.10.0040.01416.63
7.3.00.0060.00316.55
7.2.330.0080.00916.48
7.2.320.0060.01016.61
7.2.310.0110.00916.50
7.2.300.0030.01416.66
7.2.290.0060.01016.34
7.2.130.0120.00816.60
7.2.120.0110.00316.63
7.2.110.0110.00716.23
7.2.100.0060.00616.94
7.2.90.0060.01216.66
7.2.80.0090.00616.46
7.2.70.0040.01116.72
7.2.60.0060.00616.84
7.2.50.0040.01116.62
7.2.40.0070.00716.47
7.2.30.0130.00616.38
7.2.20.0090.00916.39
7.2.10.0060.00616.41
7.2.00.0060.00617.88
7.1.250.0030.01515.27
7.1.100.0000.01318.15
7.1.70.0070.00717.03
7.1.60.0090.01219.40
7.1.50.0100.01316.87
7.1.00.0000.08022.33
7.0.200.0000.00716.89
7.0.140.0000.07722.09
7.0.60.0070.04020.02
7.0.50.0030.04317.88
7.0.40.0070.06020.04
7.0.30.0330.07720.13
7.0.20.0330.06320.19
7.0.10.0130.08320.12
7.0.00.0030.08720.11
5.6.280.0100.06721.07
5.6.210.0000.09020.74
5.6.200.0030.04018.16
5.6.190.0100.08320.61
5.6.180.0230.04320.27
5.6.170.0230.07320.71
5.6.160.0100.04720.41
5.6.150.0070.06018.16
5.6.140.0000.04318.20
5.6.130.0070.07318.14
5.6.120.0100.03721.03
5.6.110.0070.05721.00
5.6.100.0070.08021.03
5.6.90.0070.04321.10
5.6.80.0030.04020.38
5.5.350.0070.05020.30
5.5.340.0030.05317.95
5.5.330.0130.07320.19
5.5.320.0530.06320.41
5.5.310.0100.05020.18
5.5.300.0100.03317.87
5.5.290.0000.04317.98
5.5.280.0030.07720.79
5.5.270.0100.08020.64
5.5.260.0070.08320.79
5.5.250.0070.07320.68
5.5.240.0330.06720.23
5.4.450.0300.06019.14
5.4.440.0270.06019.21
5.4.430.0270.07719.49
5.4.420.0370.03719.45
5.4.410.0270.06319.28
5.4.400.0230.04018.79
5.4.390.0300.05318.88
5.4.380.0330.06018.91
5.4.370.0200.04319.22
5.4.360.0300.06319.09
5.4.350.0300.03718.93
5.4.340.0270.04019.22
5.4.320.0230.04319.08
5.4.310.0270.07019.06
5.4.300.0200.04019.23
5.4.290.0270.04318.88
5.4.280.0230.04019.21
5.4.270.0170.05019.21
5.4.260.0300.06019.10
5.4.250.0330.03719.12
5.4.240.0300.04019.08
5.4.230.0300.03319.07
5.4.220.0370.05719.24
5.4.210.0270.05719.08
5.4.200.0270.04319.23
5.4.190.0200.05018.78
5.4.180.0430.06019.07
5.4.170.0270.04719.08
5.4.160.0300.03319.14
5.4.150.0400.06319.20
5.4.140.0200.05016.47
5.4.130.0270.07016.25
5.4.120.0300.03716.26
5.4.110.0230.04316.38
5.4.100.0230.07316.42
5.4.90.0200.04016.30
5.4.80.0230.03716.46
5.4.70.0370.04016.32
5.4.60.0300.06316.16
5.4.50.0230.07316.18
5.4.40.0230.03716.19
5.4.30.0330.06716.37
5.4.20.0330.05016.36
5.4.10.0230.05316.18
5.4.00.0300.06715.80
5.3.290.0230.04314.50
5.3.280.0200.04714.43
5.3.270.0330.07014.63
5.3.260.0230.04714.50
5.3.250.0300.04014.45
5.3.240.0330.03714.55
5.3.230.0330.03714.50
5.3.220.0200.04014.44
5.3.210.0330.05314.61
5.3.200.0270.03714.39
5.3.190.0270.03314.40
5.3.180.0200.04714.59
5.3.170.0200.05314.42
5.3.160.0230.03714.41
5.3.150.0300.03014.65
5.3.140.0330.04714.41
5.3.130.0300.05714.45
5.3.120.0300.07314.48
5.3.110.0300.04014.35
5.3.100.0370.06314.06
5.3.90.0370.06013.97
5.3.80.0270.05013.84
5.3.70.0270.03713.82
5.3.60.0400.02313.91
5.3.50.0230.03713.80
5.3.40.0370.03013.97
5.3.30.0300.07013.93
5.3.20.0230.03313.57
5.3.10.0230.04013.49
5.3.00.0130.04013.47
5.2.170.0300.05311.18
5.2.160.0330.06011.05
5.2.150.0330.05011.00
5.2.140.0200.04311.15
5.2.130.0170.06011.04
5.2.120.0170.03010.93
5.2.110.0200.03310.95
5.2.100.0130.03010.95
5.2.90.0270.03710.95
5.2.80.0230.02011.11
5.2.70.0130.03010.94
5.2.60.0200.02311.14
5.2.50.0200.02311.07
5.2.40.0170.02711.09
5.2.30.0100.03010.82
5.2.20.0100.03010.86
5.2.10.0100.03010.77
5.2.00.0230.01710.66
5.1.60.0070.03010.55
5.1.50.0170.02010.55
5.1.40.0130.02310.55
5.1.30.0130.02710.55
5.1.20.0170.02010.55
5.1.10.0130.02310.55
5.1.00.0130.02710.55
5.0.50.0070.02710.55
5.0.40.0170.01710.55
5.0.30.0030.03010.55
5.0.20.0000.02710.55
5.0.10.0070.02010.55
5.0.00.0070.03010.55
4.4.90.0070.01310.55
4.4.80.0030.01710.55
4.4.70.0100.01010.55
4.4.60.0100.01010.55
4.4.50.0070.01310.55
4.4.40.0070.02310.55
4.4.30.0070.01710.55
4.4.20.0030.01710.55
4.4.10.0070.01310.55
4.4.00.0100.02010.55
4.3.110.0070.01310.55
4.3.100.0070.01310.55
4.3.90.0070.01710.55
4.3.80.0030.02710.55
4.3.70.0100.01310.55
4.3.60.0070.01310.55
4.3.50.0070.01310.55
4.3.40.0030.02710.55
4.3.30.0070.01310.55
4.3.20.0070.01010.55
4.3.10.0030.01310.55
4.3.00.0070.01310.55

preferences:
49.86 ms | 401 KiB | 5 Q