3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getPatientCodeDisplay($id='') { if(intval($id)>0) { $id_length = strlen($id); $prefix_code = "AHD"; $final_len = 6+strlen($prefix_code)-$id_length; $retstr = str_pad($prefix_code, $final_len, "0", STR_PAD_RIGHT); $retstr .= $id; } else { $retstr = ""; } return $retstr; } echo getPatientCodeDisplay(1)." >> "; echo getPatientCodeDisplay(12)." >> "; echo getPatientCodeDisplay(123)." >> "; echo getPatientCodeDisplay(1234)." >> "; echo getPatientCodeDisplay(12345)." >> "; echo getPatientCodeDisplay(123456)." >> "; echo getPatientCodeDisplay(1234567)." >> ";

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.00616.50
8.3.50.0120.00822.16
8.3.40.0120.00318.85
8.3.30.0040.01119.08
8.3.20.0040.00420.35
8.3.10.0080.00023.48
8.3.00.0040.00422.58
8.2.180.0090.00616.38
8.2.170.0120.00322.96
8.2.160.0070.01020.39
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0130.00626.16
8.2.120.0080.00022.18
8.2.110.0070.00322.07
8.2.100.0040.00717.78
8.2.90.0070.00019.19
8.2.80.0000.00818.04
8.2.70.0030.00617.50
8.2.60.0050.00517.93
8.2.50.0050.00518.07
8.2.40.0090.00018.34
8.2.30.0000.00818.05
8.2.20.0000.00817.80
8.2.10.0080.00019.41
8.2.00.0040.00417.70
8.1.280.0130.00725.92
8.1.270.0050.00323.83
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0030.00624.02
8.1.230.0080.00318.94
8.1.220.0060.00317.79
8.1.210.0000.00818.77
8.1.200.0030.00617.23
8.1.190.0040.00417.40
8.1.180.0030.00518.10
8.1.170.0000.00818.69
8.1.160.0000.00721.97
8.1.150.0000.00718.59
8.1.140.0030.00617.46
8.1.130.0000.00717.86
8.1.120.0070.00017.48
8.1.110.0040.00417.34
8.1.100.0040.00417.44
8.1.90.0000.00817.47
8.1.80.0040.00417.38
8.1.70.0070.00017.39
8.1.60.0040.00417.50
8.1.50.0040.00417.46
8.1.40.0040.00417.48
8.1.30.0040.00417.46
8.1.20.0070.00017.72
8.1.10.0040.00417.52
8.1.00.0040.00417.35
8.0.300.0040.00418.77
8.0.290.0000.00817.28
8.0.280.0040.00418.37
8.0.270.0000.00817.21
8.0.260.0070.00016.75
8.0.250.0030.00316.92
8.0.240.0000.00716.98
8.0.230.0070.00016.97
8.0.220.0030.00516.91
8.0.210.0000.00716.84
8.0.200.0000.00616.80
8.0.190.0070.00016.90
8.0.180.0000.00716.85
8.0.170.0040.00416.92
8.0.160.0040.00416.79
8.0.150.0040.00416.92
8.0.140.0000.00816.89
8.0.130.0000.00513.36
8.0.120.0000.00816.89
8.0.110.0000.00716.83
8.0.100.0000.00716.85
8.0.90.0080.00016.98
8.0.80.0130.00716.86
8.0.70.0070.00016.86
8.0.60.0000.00816.82
8.0.50.0040.00416.83
8.0.30.0120.00716.93
8.0.20.0120.00717.40
8.0.10.0050.00216.79
8.0.00.0110.00816.89
7.4.330.0000.00515.00
7.4.320.0040.00416.54
7.4.300.0070.00016.61
7.4.290.0030.00316.67
7.4.280.0030.00316.51
7.4.270.0070.00016.46
7.4.260.0040.00716.52
7.4.250.0050.00316.50
7.4.240.0020.00616.61
7.4.230.0030.00316.55
7.4.220.0090.00916.69
7.4.210.0070.00916.61
7.4.200.0040.00416.64
7.4.190.0040.00416.53
7.4.160.0060.00916.33
7.4.150.0060.01217.40
7.4.140.0110.00617.86
7.4.130.0090.00916.56
7.4.120.0090.00916.67
7.4.110.0100.00716.54
7.4.100.0070.01116.32
7.4.90.0100.00716.53
7.4.80.0100.00719.39
7.4.70.0140.00316.66
7.4.60.0180.00016.48
7.4.50.0090.00016.26
7.4.40.0080.00622.77
7.4.30.0060.00916.54
7.4.00.0100.00714.75
7.3.330.0000.00513.20
7.3.320.0000.00613.37
7.3.310.0030.00316.40
7.3.300.0000.00716.29
7.3.290.0030.01116.43
7.3.280.0080.01016.37
7.3.270.0060.00917.40
7.3.260.0110.00616.40
7.3.250.0130.00516.34
7.3.240.0150.00016.35
7.3.230.0060.01216.50
7.3.210.0110.00616.59
7.3.200.0060.01019.39
7.3.190.0160.00816.57
7.3.180.0130.00316.65
7.3.170.0120.00316.47
7.3.160.0120.00316.38
7.3.120.0030.01014.98
7.2.330.0110.00616.46
7.2.320.0120.00416.73
7.2.310.0060.01016.46
7.2.300.0070.01016.47
7.2.290.0120.00416.52
7.2.60.0030.00916.90
7.1.200.0040.00715.75
7.1.70.0000.00817.09
7.1.60.0100.01419.29
7.1.50.0000.01616.81
7.1.00.0030.07322.51
7.0.200.0040.00416.78
7.0.140.0070.07022.09
7.0.120.0000.06022.04
7.0.110.0070.07322.12
7.0.100.0030.07022.02
7.0.90.0030.07022.13
7.0.80.0070.06022.18
7.0.70.0000.07722.06
7.0.60.0000.07722.04
7.0.50.0070.06322.16
7.0.40.0070.07022.07
7.0.30.0030.07322.15
7.0.20.0070.06322.19
7.0.10.0100.06722.17
7.0.00.0070.07022.06
5.6.280.0000.07721.02
5.6.260.0000.07721.09
5.6.250.0000.07720.99
5.6.240.0000.08021.10
5.6.230.0030.07721.10
5.6.220.0000.07720.86
5.6.210.0030.07321.00
5.6.200.0100.07020.94
5.6.190.0000.08021.00
5.6.180.0070.06720.95
5.6.170.0030.06320.93
5.6.160.0030.07321.03
5.6.150.0030.07321.04
5.6.140.0030.07320.75
5.6.130.0000.07720.80
5.6.120.0000.08021.00
5.6.110.0100.06721.03
5.6.100.0030.07720.93
5.6.90.0030.06720.79
5.6.80.0030.07020.44
5.6.70.0000.04320.38
5.6.60.0000.07320.41
5.6.50.0030.06720.22
5.6.40.0100.05720.37
5.6.30.0030.07320.41
5.6.20.0070.07020.44
5.6.10.0070.06720.30
5.6.00.0070.06720.34
5.5.380.0000.07317.57
5.5.370.0000.07317.47
5.5.360.0030.07017.68
5.5.350.0070.06717.51
5.5.340.0000.07318.22
5.5.330.0030.07018.09
5.5.320.0000.06718.23
5.5.310.0030.06018.13
5.5.300.0070.07018.23
5.5.290.0070.07317.93
5.5.280.0030.07318.25
5.5.270.0030.07718.05
5.5.260.0030.06317.95
5.5.250.0000.06717.90
5.5.240.0070.05317.48
5.5.230.0070.06717.34
5.5.220.0000.07317.48
5.5.210.0030.07017.21
5.5.200.0030.06717.27
5.5.190.0030.06717.30
5.5.180.0030.06717.43
5.5.160.0030.06317.61
5.5.150.0070.06017.30
5.5.140.0030.07017.30
5.5.130.0000.06717.57
5.5.120.0030.06717.48
5.5.110.0000.06717.18
5.5.100.0000.07017.19
5.5.90.0000.05017.37
5.5.80.0000.07017.38
5.5.70.0100.05317.11
5.5.60.0030.06017.46
5.5.50.0070.06317.29
5.5.40.0000.06717.17
5.5.30.0030.06717.17
5.5.20.0030.06717.32
5.5.10.0000.07317.33
5.5.00.0070.06717.14
5.4.450.0070.07019.27
5.4.440.0070.07019.65
5.4.430.0100.06719.41
5.4.420.0030.07019.34
5.4.410.0000.06719.36
5.4.400.0030.06019.17
5.4.390.0000.07019.00
5.4.380.0030.06719.00
5.4.370.0030.06719.16
5.4.360.0070.06719.22
5.4.350.0030.06719.18
5.4.340.0000.07019.00
5.4.320.0000.07019.00
5.4.310.0030.06319.14
5.4.300.0000.07019.12
5.4.290.0030.06719.09
5.4.280.0030.06719.32
5.4.270.0070.06319.01
5.4.260.0030.06718.97
5.4.250.0030.06318.94
5.4.240.0030.07018.96
5.4.230.0070.06319.07
5.4.220.0070.06719.15
5.4.210.0000.07319.17
5.4.200.0130.05719.16
5.4.190.0000.07018.98
5.4.180.0000.07018.98
5.4.170.0070.06319.17
5.4.160.0030.06719.14
5.4.150.0030.06318.98
5.4.140.0000.07016.29
5.4.130.0000.06716.46
5.4.120.0000.05716.42
5.4.110.0000.07016.46
5.4.100.0000.06716.46
5.4.90.0030.06316.35
5.4.80.0030.06016.44
5.4.70.0030.06316.57
5.4.60.0030.06316.63
5.4.50.0030.06316.55
5.4.40.0000.06716.45
5.4.30.0030.06316.39
5.4.20.0000.06716.62
5.4.10.0030.06716.43
5.4.00.0000.06316.00
5.3.290.0030.07014.66
5.3.280.0070.06314.59
5.3.270.0070.06314.75
5.3.260.0000.06714.69
5.3.250.0030.05314.73
5.3.240.0030.05014.60
5.3.230.0030.06714.61
5.3.220.0030.06714.59
5.3.210.0100.06314.70
5.3.200.0070.06014.57
5.3.190.0030.06314.55
5.3.180.0000.05714.57
5.3.170.0070.06314.56
5.3.160.0030.05714.80
5.3.150.0000.07014.52
5.3.140.0000.06714.55
5.3.130.0070.06014.68
5.3.120.0030.07014.52
5.3.110.0030.07014.78
5.3.100.0000.06714.02
5.3.90.0100.05314.05
5.3.80.0000.06714.06
5.3.70.0000.06714.01
5.3.60.0030.06014.04
5.3.50.0000.05313.98
5.3.40.0030.05313.91
5.3.30.0030.06014.05
5.3.20.0030.06013.70
5.3.10.0000.06313.67
5.3.00.0000.05013.66
5.2.170.0000.05711.14
5.2.160.0000.04711.16
5.2.150.0000.05711.27
5.2.140.0000.06011.16
5.2.130.0030.04311.09
5.2.120.0000.05011.12
5.2.110.0070.05011.13
5.2.100.0000.03711.11
5.2.90.0030.05311.09
5.2.80.0030.05311.05
5.2.70.0000.05711.11
5.2.60.0000.05711.18
5.2.50.0000.05311.24
5.2.40.0000.05710.98
5.2.30.0100.05010.95
5.2.20.0000.05710.96
5.2.10.0070.04710.72
5.2.00.0070.05010.84
5.1.60.0000.04710.07
5.1.50.0000.05010.02
5.1.40.0070.04310.02
5.1.30.0030.04710.35
5.1.20.0030.04310.48
5.1.10.0070.04010.04
5.1.00.0000.04710.24
5.0.50.0000.04010.02
5.0.40.0030.03010.02
5.0.30.0000.05010.02
5.0.20.0000.03710.02
5.0.10.0030.03710.02
5.0.00.0000.05710.02
4.4.90.0000.03010.02
4.4.80.0000.03010.02
4.4.70.0000.03010.02
4.4.60.0000.03010.02
4.4.50.0030.02710.02
4.4.40.0070.04310.02
4.4.30.0000.03010.02
4.4.20.0000.03010.02
4.4.10.0000.03010.02
4.4.00.0000.04710.02
4.3.110.0000.03310.02
4.3.100.0030.02310.02
4.3.90.0000.03010.02
4.3.80.0000.04310.02
4.3.70.0030.02710.02
4.3.60.0030.02710.02
4.3.50.0000.03010.02
4.3.40.0000.04710.02
4.3.30.0000.03310.02
4.3.20.0000.03310.02
4.3.10.0000.03010.02
4.3.00.0000.02710.02

preferences:
53.62 ms | 400 KiB | 5 Q