3v4l.org

run code in 300+ PHP versions simultaneously
<?php function oldTextual($steamid) { $result = 'Invalid input.'; if (!preg_match('([a-zA-Z])', $steamid) && strlen($steamid) === 17) { // 64-bit int $acc_id = bcsub($steamid, '76561197960265728'); $result = 'STEAM_0:'; if ($acc_id % 2 === 0) $result .= '0:'; else $result .= '1:'; $result .= bcdiv($acc_id, '2', 0); } if (substr($steamid, 0, 2) === "U:") { // New textual format $split = explode(':', $steamid); $result = 'STEAM_0:'; $z = (int)$split[2]; if ($z % 2 === 0) $result .= '0:'; else $result .= '1:'; $acc_id = bcdiv($z, '2', 0); $result .= $acc_id; } return $result; } function newTextual($steamid) { $result = 'Invalid input.'; if (substr($steamid, 0, 6) === 'STEAM_') { // Old textual format $split = explode(':', $steamid); $y = $split[1]; $z = $split[2]; $acc_id = bcadd(bcmul($z, '2'), $y); $result = 'U:1:' . $acc_id; } if (!preg_match('([a-zA-Z])', $steamid) && strlen($steamid) === 17) { // 64-bit int $acc_id = bcsub($steamid, '76561197960265728'); $result = 'U:1:' . $acc_id; } return $result; } function numeric($steamid) { $result = 'Invalid input.'; if (substr($steamid, 0, 6) === 'STEAM_') { // Old textual format $split = explode(':', $steamid); $commid = bcmul($split[2], '2'); if ($split[1] === '1') $commid = bcadd($commid, '1'); $result = bcadd($commid, '76561197960265728'); } if (substr($steamid, 0, 2) === "U:") { // New textual format $filter = str_replace(array('[', ']'), '', $steamid); $split = explode(':', $filter); $result = bcadd($split[2], '76561197960265728'); } return $result; } $steamid64 = '76561198074715892'; $steamid32 = 'STEAM_0:0:57225082'; $steamid3 = 'U:1:114450164'; echo oldTextual($steamid64) . '<br>'; echo oldTextual($steamid3) . '<br>'; echo newTextual($steamid64) . '<br>'; echo newTextual($steamid32) . '<br>'; echo 'http://steamcommunity.com/profiles/' . numeric($steamid32) . '<br>'; echo 'http://steamcommunity.com/profiles/' . numeric($steamid3);

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.0120.00618.43
8.3.50.0190.00318.12
8.3.40.0150.00019.02
8.3.30.0070.01518.88
8.3.20.0040.00420.29
8.3.10.0060.00320.71
8.3.00.0040.00419.63
8.2.180.0140.00416.88
8.2.170.0070.00722.96
8.2.160.0100.00320.52
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0080.00022.04
8.2.110.0030.00620.44
8.2.100.0050.00518.22
8.2.90.0040.00419.35
8.2.80.0040.00417.97
8.2.70.0060.00317.88
8.2.60.0000.00817.68
8.2.50.0090.00018.07
8.2.40.0000.00718.22
8.2.30.0100.00018.20
8.2.20.0000.00817.78
8.2.10.0080.00018.14
8.2.00.0040.00417.71
8.1.280.0130.00625.92
8.1.270.0080.00023.97
8.1.260.0000.00726.35
8.1.250.0050.00328.09
8.1.240.0040.00422.12
8.1.230.0090.00318.92
8.1.220.0030.00517.77
8.1.210.0050.00318.77
8.1.200.0040.00417.25
8.1.190.0000.00817.35
8.1.180.0000.00718.10
8.1.170.0040.00418.77
8.1.160.0050.00322.05
8.1.150.0000.00818.96
8.1.140.0020.00517.50
8.1.130.0000.00717.81
8.1.120.0040.00417.67
8.1.110.0060.00317.48
8.1.100.0040.00417.59
8.1.90.0000.00717.66
8.1.80.0070.00017.52
8.1.70.0000.00717.57
8.1.60.0040.00417.57
8.1.50.0000.00917.66
8.1.40.0080.00017.68
8.1.30.0040.00417.88
8.1.20.0050.00317.72
8.1.10.0040.00417.71
8.1.00.0040.00417.63
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0070.00018.48
8.0.270.0030.00317.16
8.0.260.0030.00317.29
8.0.250.0040.00417.05
8.0.240.0070.00017.09
8.0.230.0040.00417.03
8.0.220.0000.00716.97
8.0.210.0070.00017.04
8.0.200.0000.00817.13
8.0.190.0030.00617.16
8.0.180.0070.00417.12
8.0.170.0000.00817.03
8.0.160.0050.00216.94
8.0.150.0000.00717.02
8.0.140.0000.00816.93
8.0.130.0060.00013.52
8.0.120.0040.00417.00
8.0.110.0040.00417.10
8.0.100.0040.00416.93
8.0.90.0040.00417.05
8.0.80.0070.01416.99
8.0.70.0000.00717.08
8.0.60.0040.00416.91
8.0.50.0070.00017.11
8.0.30.0150.00717.31
8.0.20.0120.01017.49
8.0.10.0040.00417.15
8.0.00.0140.00316.94
7.4.330.0050.00015.00
7.4.320.0060.00016.79
7.4.300.0060.00016.82
7.4.290.0000.00716.73
7.4.280.0040.00416.70
7.4.270.0000.00716.79
7.4.260.0080.00016.71
7.4.250.0000.00816.79
7.4.240.0040.00416.76
7.4.230.0070.00016.57
7.4.220.0100.01016.68
7.4.210.0140.00716.69
7.4.200.0080.00016.73
7.4.160.0030.01316.70
7.4.150.0080.01217.40
7.4.140.0060.01417.86
7.4.130.0100.00816.74
7.4.120.0110.00716.75
7.4.110.0110.00816.68
7.4.100.0030.01316.61
7.4.90.0120.00616.69
7.4.80.0110.00719.37
7.4.70.0160.00016.67
7.4.60.0040.01816.73
7.4.50.0040.00416.59
7.4.40.0090.00916.52
7.4.30.0120.00616.49
7.4.00.0130.00314.79
7.3.330.0060.00013.46
7.3.320.0040.00413.37
7.3.310.0040.00416.52
7.3.300.0080.00016.54
7.3.290.0090.00616.58
7.3.280.0100.00916.52
7.3.270.0040.01517.40
7.3.260.0090.00916.75
7.3.250.0120.00816.60
7.3.240.0110.01116.50
7.3.230.0090.00816.50
7.3.210.0150.00616.76
7.3.200.0070.01319.39
7.3.190.0070.01416.80
7.3.180.0090.00716.47
7.3.170.0080.01216.92
7.3.160.0090.00916.88
7.2.330.0070.01016.97
7.2.320.0120.00617.08
7.2.310.0040.01716.92
7.2.300.0100.00716.87
7.2.290.0070.01116.94
7.2.00.0030.01019.73
7.1.100.0090.00318.70
7.1.70.0000.00817.23
7.1.60.0100.01319.32
7.1.50.0030.01317.09
7.1.00.0000.07722.34
7.0.200.0030.00616.95
7.0.140.0000.07722.21
7.0.110.0030.05720.00
7.0.100.0100.08319.95
7.0.90.0070.06720.04
7.0.80.0030.08320.02
7.0.70.0200.05719.90
7.0.60.0270.05720.02
7.0.50.0000.07719.82
7.0.40.0130.07719.73
7.0.30.0100.05719.66
7.0.20.0070.07019.70
7.0.10.0070.06719.72
7.0.00.0170.07319.61
5.6.280.0070.07021.03
5.6.260.0130.03020.57
5.6.250.0230.06720.69
5.6.240.0030.04320.48
5.6.230.0100.06720.70
5.6.220.0000.04320.85
5.6.210.0030.04720.61
5.6.200.0030.04020.57
5.6.190.0100.08020.84
5.6.180.0070.07720.71
5.6.170.0070.03720.66
5.6.160.0030.06720.68
5.6.150.0070.08320.63
5.6.140.0100.07720.47
5.6.130.0070.03720.47
5.6.120.0000.06720.63
5.6.110.0070.05320.67
5.6.100.0100.07320.63
5.6.90.0000.08720.64
5.6.80.0070.07019.98
5.6.70.0000.08319.97
5.6.60.0100.07720.02
5.6.50.0100.04020.03
5.6.40.0070.07720.07
5.6.30.0170.06719.98
5.6.20.0130.03719.98
5.6.10.0130.06319.99
5.6.00.0070.04319.95
5.5.380.0100.07017.64
5.5.370.0070.07317.52
5.5.360.0030.04017.68
5.5.350.0070.03317.63
5.5.340.0030.04018.23
5.5.330.0070.04317.91
5.5.320.0030.04318.13
5.5.310.0100.07318.13
5.5.300.0070.03317.93
5.5.290.0100.05018.05
5.5.280.0100.07317.91
5.5.270.0030.08017.92
5.5.260.0130.07318.13
5.5.250.0100.06317.91
5.5.240.0130.05017.30
5.5.230.0030.07717.48
5.5.220.0070.07717.60
5.5.210.0200.06717.51
5.5.200.0100.08017.31
5.5.190.0070.04017.19
5.5.180.0070.03317.43
5.5.160.0100.05717.48
5.5.150.0070.02717.31
5.5.140.0070.07717.41
5.5.130.0100.05317.30
5.5.120.0100.07017.42
5.5.110.0130.07017.27
5.5.100.0000.08317.51
5.5.90.0000.04717.47
5.5.80.0070.07017.48
5.5.70.0030.07717.46
5.5.60.0000.04717.33
5.5.50.0070.07317.47
5.5.40.0100.07317.29
5.5.30.0100.07317.36
5.5.20.0030.08017.20
5.5.10.0070.04717.45
5.5.00.0030.07717.20
5.4.450.0170.07719.57
5.4.440.0070.07719.49
5.4.430.0130.07019.48
5.4.420.0030.04019.49
5.4.410.0000.08719.51
5.4.400.0070.08018.95
5.4.390.0100.06319.16
5.4.380.0100.06318.99
5.4.370.0070.07719.32
5.4.360.0030.05019.14
5.4.350.0070.04019.33
5.4.340.0030.08319.14
5.4.320.0070.04019.18
5.4.310.0170.06319.03
5.4.300.0070.05019.14
5.4.290.0130.06318.95
5.4.280.0100.07319.19
5.4.270.0070.07019.18
5.4.260.0130.06719.24
5.4.250.0070.07719.02
5.4.240.0170.06319.20
5.4.230.0170.06719.22
5.4.220.0130.05719.01
5.4.210.0070.08318.98
5.4.200.0100.07319.17
5.4.190.0130.07319.01
5.4.180.0000.08319.02
5.4.170.0070.07319.02
5.4.160.0070.07718.98
5.4.150.0100.04018.96
5.4.140.0030.07016.56
5.4.130.0030.07316.48
5.4.120.0130.06716.36
5.4.110.0030.03316.65
5.4.100.0070.07016.61
5.4.90.0030.07016.63
5.4.80.0100.06716.69
5.4.70.0100.06316.40
5.4.60.0030.07016.25
5.4.50.0030.07716.54
5.4.40.0030.06716.34
5.4.30.0030.08016.35
5.4.20.0100.07016.39
5.4.10.0000.05316.52
5.4.00.0070.03315.97
5.3.290.0030.04714.70
5.3.280.0130.03314.61
5.3.270.0070.07314.64
5.3.260.0000.08314.75
5.3.250.0130.07014.64
5.3.240.0070.07314.58
5.3.230.0030.07314.65
5.3.220.0170.06314.60
5.3.210.0030.03714.58
5.3.200.0000.04014.72
5.3.190.0100.03014.59
5.3.180.0070.07014.55
5.3.170.0030.03314.59
5.3.160.0000.03714.60
5.3.150.0070.07314.71
5.3.140.0030.08014.59
5.3.130.0000.08714.42
5.3.120.0030.07314.70
5.3.110.0200.06714.60
5.3.100.0070.03014.02
5.3.90.0070.07014.17
5.3.80.0070.05014.04
5.3.70.0030.04714.04
5.3.60.0100.06313.88
5.3.50.0030.06713.82
5.3.40.0070.05013.98
5.3.30.0070.03013.96
5.3.20.0070.06313.85
5.3.10.0100.07013.81
5.3.00.0070.07313.61
5.2.170.0070.06011.92
5.2.160.0130.05311.92
5.2.150.0000.03011.92
5.2.140.0000.03011.92
5.2.130.0030.03311.92
5.2.120.0030.06011.92
5.2.110.0030.05711.92
5.2.100.0030.06711.92
5.2.90.0000.04011.92
5.2.80.0100.07311.92
5.2.70.0070.06011.92
5.2.60.0170.05011.92
5.2.50.0100.06311.92
5.2.40.0070.03011.92
5.2.30.0100.04711.92
5.2.20.0030.06311.92
5.2.10.0030.05711.92
5.2.00.0030.02711.92
5.1.60.0000.05011.92
5.1.50.0030.05311.92
5.1.40.0030.03311.92
5.1.30.0100.04011.92
5.1.20.0070.05311.92
5.1.10.0000.05011.92
5.1.00.0000.04011.92
5.0.50.0070.02711.92
5.0.40.0000.02011.92
5.0.30.0030.04711.92
5.0.20.0030.04311.92
5.0.10.0000.04711.92
5.0.00.0070.06011.92
4.4.90.0000.03311.92
4.4.80.0030.03011.92
4.4.70.0030.03311.92
4.4.60.0100.02711.92
4.4.50.0030.03311.92
4.4.40.0030.02311.92
4.4.30.0030.03711.92
4.4.20.0030.03311.92
4.4.10.0030.01711.92
4.4.00.0030.05011.92
4.3.110.0000.03711.92
4.3.100.0070.01311.92
4.3.90.0000.02011.92
4.3.80.0030.05311.92
4.3.70.0000.03711.92
4.3.60.0030.03011.92
4.3.50.0000.02711.92
4.3.40.0070.04711.92
4.3.30.0030.03711.92
4.3.20.0030.02711.92
4.3.10.0000.02311.92
4.3.00.0030.03311.92

preferences:
52.81 ms | 400 KiB | 5 Q