3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getPatientCodeDisplay($id='') { $retstr = ""; if(intval($id)>0) { $max_id_length = 6; $id_length = strlen($id); if($id_length <= $max_id_length) { $prefix_code = "AHD"; $final_len = $max_id_length+strlen($prefix_code)-$id_length; $retstr = str_pad($prefix_code, $final_len, "0", STR_PAD_RIGHT); $retstr .= $id; } } return $retstr; } echo getPatientCodeDisplay("5").">>>>>>"; echo getPatientCodeDisplay("10").">>>>>>"; echo getPatientCodeDisplay("111").">>>>>>";

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.0090.01216.75
8.3.50.0120.01017.50
8.3.40.0070.00718.84
8.3.30.0080.00818.67
8.3.20.0040.00418.83
8.3.10.0080.00018.78
8.3.00.0040.00419.26
8.2.180.0060.00916.75
8.2.170.0100.01022.96
8.2.160.0100.00320.29
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0040.00419.48
8.2.110.0060.00622.21
8.2.100.0090.00317.84
8.2.90.0040.00417.84
8.2.80.0040.00417.97
8.2.70.0000.00817.63
8.2.60.0040.00418.04
8.2.50.0040.00418.05
8.2.40.0040.00419.35
8.2.30.0000.00817.74
8.2.20.0000.01017.74
8.2.10.0060.00317.73
8.2.00.0040.00417.68
8.1.280.0070.01025.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0100.00722.55
8.1.230.0080.00420.80
8.1.220.0030.00517.78
8.1.210.0030.00618.99
8.1.200.0090.00017.12
8.1.190.0030.00517.23
8.1.180.0040.00418.10
8.1.170.0030.00617.62
8.1.160.0040.00419.02
8.1.150.0000.00718.64
8.1.140.0070.00017.40
8.1.130.0050.00317.49
8.1.120.0000.00717.43
8.1.110.0080.00017.45
8.1.100.0000.00817.41
8.1.90.0000.00817.37
8.1.80.0000.00717.51
8.1.70.0000.00817.48
8.1.60.0040.00417.61
8.1.50.0040.00417.57
8.1.40.0050.00317.54
8.1.30.0040.00417.62
8.1.20.0030.00617.67
8.1.10.0000.00817.54
8.1.00.0040.00417.48
8.0.300.0000.00819.90
8.0.290.0070.00016.75
8.0.280.0050.00518.57
8.0.270.0030.00317.18
8.0.260.0070.00016.84
8.0.250.0100.00016.88
8.0.240.0040.00417.05
8.0.230.0040.00416.95
8.0.220.0000.00916.79
8.0.210.0000.00716.88
8.0.200.0030.00316.88
8.0.190.0000.00716.93
8.0.180.0000.00816.93
8.0.170.0030.00516.88
8.0.160.0070.00016.80
8.0.150.0080.00016.90
8.0.140.0000.00716.82
8.0.130.0030.00313.37
8.0.120.0080.00016.73
8.0.110.0000.00716.84
8.0.100.0050.00216.77
8.0.90.0000.00716.89
8.0.80.0040.01116.78
8.0.70.0030.00516.78
8.0.60.0060.00316.87
8.0.50.0060.00316.95
8.0.30.0120.00917.13
8.0.20.0100.00917.23
8.0.10.0040.00417.04
8.0.00.0070.01216.70
7.4.330.0030.00313.03
7.4.320.0060.00016.58
7.4.300.0030.00316.60
7.4.290.0000.00916.59
7.4.280.0050.00216.42
7.4.270.0030.00616.45
7.4.260.0030.00313.30
7.4.250.0080.00016.45
7.4.240.0000.00816.61
7.4.230.0000.00716.62
7.4.220.0060.01216.60
7.4.210.0060.00816.63
7.4.200.0000.00716.58
7.4.190.0000.00816.70
7.4.160.0080.00816.29
7.4.150.0120.00616.63
7.4.140.0160.01017.86
7.4.130.0060.01216.53
7.4.120.0150.00916.51
7.4.110.0120.00816.79
7.4.100.0180.01016.52
7.4.90.0070.01116.44
7.4.80.0060.01719.39
7.4.70.0130.00716.63
7.4.60.0130.00316.49
7.4.50.0030.00316.50
7.4.40.0070.01016.31
7.4.30.0170.00316.51
7.4.00.0120.00314.95
7.3.330.0000.00713.37
7.3.320.0000.00613.21
7.3.310.0000.00716.37
7.3.300.0000.00716.45
7.3.290.0080.00616.36
7.3.280.0090.00516.35
7.3.270.0110.00716.44
7.3.260.0090.00916.49
7.3.240.0090.01316.34
7.3.230.0090.01216.57
7.3.210.0070.01016.51
7.3.200.0110.00816.60
7.3.190.0060.01016.47
7.3.180.0000.01716.46
7.3.170.0030.01416.37
7.3.160.0120.00916.29
7.3.120.0040.01214.90
7.2.330.0120.00616.40
7.2.320.0130.00316.55
7.2.310.0120.01616.43
7.2.300.0030.01516.65
7.2.290.0070.01016.79
7.2.60.0000.01416.88
7.2.00.0070.00319.59
7.1.200.0030.01015.90
7.1.100.0030.00618.31
7.1.70.0000.01117.21
7.1.60.0000.02519.21
7.1.50.0060.01917.02
7.1.00.0100.07022.36
7.0.200.0030.00816.59
7.0.140.0130.06022.21
7.0.120.0030.07321.95
7.0.60.0170.05319.91
7.0.50.0070.04017.97
7.0.40.0070.04717.73
7.0.30.0070.08317.86
7.0.20.0070.06717.87
7.0.10.0130.05317.84
7.0.00.0000.05317.73
5.6.210.0100.08020.45
5.6.200.0030.07318.25
5.6.190.0170.07318.29
5.6.180.0130.07318.23
5.6.170.0100.07718.17
5.6.160.0030.08718.29
5.6.150.0070.05718.12
5.6.140.0200.06018.17
5.6.130.0100.08018.11
5.6.120.0130.08018.18
5.6.110.0070.07318.13
5.6.100.0100.06318.18
5.6.90.0070.08718.17
5.6.80.0030.07317.54
5.6.70.0100.07017.65
5.6.60.0000.04317.55
5.6.50.0100.07317.53
5.6.40.0100.07717.54
5.6.30.0130.06717.50
5.6.20.0130.07317.57
5.6.10.0130.06717.63
5.6.00.0130.07017.61
5.5.350.0000.08320.34
5.5.340.0130.03717.96
5.5.330.0100.05717.98
5.5.320.0030.07318.05
5.5.310.0070.08317.99
5.5.300.0000.05018.04
5.5.290.0070.04717.95
5.5.280.0130.06317.97
5.5.270.0130.07317.91
5.5.260.0100.05317.97
5.5.250.0100.06317.83
5.5.240.0070.07317.38
5.5.230.0100.07717.36
5.5.220.0100.05017.42
5.5.210.0030.04317.45
5.5.200.0070.04717.43
5.5.190.0170.07017.30
5.5.180.0100.05317.36
5.5.160.0070.08017.42
5.5.150.0100.06717.29
5.5.140.0030.08017.27
5.5.130.0070.05317.30
5.5.120.0030.04717.27
5.5.110.0000.08717.43
5.5.100.0070.04017.24
5.5.90.0100.07017.33
5.5.80.0030.04717.26
5.5.70.0030.04717.21
5.5.60.0070.07317.28
5.5.50.0070.07017.21
5.5.40.0170.06317.18
5.5.30.0100.06717.23
5.5.20.0100.06717.22
5.5.10.0100.06317.19
5.5.00.0030.05317.23
5.4.450.0100.07719.36
5.4.440.0170.07319.36
5.4.430.0030.08719.41
5.4.420.0030.07319.32
5.4.410.0000.08719.21
5.4.400.0100.06718.96
5.4.390.0170.06719.13
5.4.380.0000.06319.13
5.4.370.0070.07318.99
5.4.360.0030.05318.96
5.4.350.0130.07019.12
5.4.340.0030.04719.12
5.4.320.0130.07319.12
5.4.310.0000.09019.09
5.4.300.0000.08719.03
5.4.290.0200.06019.01
5.4.280.0030.06719.12
5.4.270.0170.07019.02
5.4.260.0030.07018.98
5.4.250.0070.07719.09
5.4.240.0100.06018.95
5.4.230.0030.05319.26
5.4.220.0200.07319.02
5.4.210.0130.05318.88
5.4.200.0130.07018.94
5.4.190.0100.07019.15
5.4.180.0030.07719.08
5.4.170.0070.08018.94
5.4.160.0100.04019.25
5.4.150.0070.04718.96
5.4.140.0000.04716.41
5.4.130.0070.05316.23
5.4.120.0000.04316.39
5.4.110.0070.03316.43
5.4.100.0070.04716.43
5.4.90.0070.03716.23
5.4.80.0070.07316.30
5.4.70.0070.05716.44
5.4.60.0100.06316.47
5.4.50.0070.07016.36
5.4.40.0000.08016.40
5.4.30.0000.07016.40
5.4.20.0100.05316.44
5.4.10.0200.05316.39
5.4.00.0100.07315.83
5.3.290.0100.07714.88
5.3.280.0070.04714.69
5.3.270.0070.07714.71
5.3.260.0070.08014.61
5.3.250.0070.07314.46
5.3.240.0070.03714.66
5.3.230.0000.04014.60
5.3.220.0030.04714.57
5.3.210.0070.06714.65
5.3.200.0000.04014.59
5.3.190.0130.07014.60
5.3.180.0070.05314.52
5.3.170.0100.05014.53
5.3.160.0130.06314.57
5.3.150.0100.07014.61
5.3.140.0100.07314.60
5.3.130.0030.04014.59
5.3.120.0070.03714.57
5.3.110.0070.07314.59
5.3.100.0130.05014.24
5.3.90.0100.04014.04
5.3.80.0030.07714.04
5.3.70.0000.04014.02
5.3.60.0070.03714.03
5.3.50.0070.05013.94
5.3.40.0100.05013.96
5.3.30.0070.07013.80
5.3.20.0070.04313.73
5.3.10.0000.06013.54
5.3.00.0030.08013.64
5.2.170.0100.06011.19
5.2.160.0030.05711.05
5.2.150.0070.06011.25
5.2.140.0030.04711.04
5.2.130.0030.04711.00
5.2.120.0070.06011.11
5.2.110.0130.05711.12
5.2.100.0130.02711.07
5.2.90.0000.05311.14
5.2.80.0070.06311.13
5.2.70.0030.05311.00
5.2.60.0030.06311.06
5.2.50.0030.03711.04
5.2.40.0070.04711.04
5.2.30.0030.06710.99
5.2.20.0070.05310.91
5.2.10.0030.05710.75
5.2.00.0100.04310.81
5.1.60.0030.0579.96
5.1.50.0000.0279.94
5.1.40.0070.0239.95
5.1.30.0070.02710.40
5.1.20.0070.05310.40
5.1.10.0070.05710.28
5.1.00.0070.05310.12
5.0.50.0030.0478.46
5.0.40.0030.0438.39
5.0.30.0000.0608.19
5.0.20.0000.0378.23
5.0.10.0030.0478.26
5.0.00.0000.0738.12
4.4.90.0030.0308.08
4.4.80.0030.0338.08
4.4.70.0070.0308.08
4.4.60.0000.0308.08
4.4.50.0100.0308.08
4.4.40.0000.0438.08
4.4.30.0000.0178.08
4.4.20.0000.0408.08
4.4.10.0000.0378.08
4.4.00.0030.0578.08
4.3.110.0030.0378.08
4.3.100.0000.0338.08
4.3.90.0000.0208.08
4.3.80.0000.0538.08
4.3.70.0030.0338.08
4.3.60.0070.0308.08
4.3.50.0000.0238.08
4.3.40.0100.0338.08
4.3.30.0000.0208.08
4.3.20.0030.0208.08
4.3.10.0000.0208.08
4.3.00.0000.0308.08

preferences:
46.86 ms | 401 KiB | 5 Q