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(['[', ']'], '', $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.0090.00618.68
8.3.50.0120.00922.19
8.3.40.0070.00718.94
8.3.30.0100.00319.04
8.3.20.0110.00420.30
8.3.10.0000.00820.69
8.3.00.0030.00619.50
8.2.180.0140.00417.00
8.2.170.0040.01122.96
8.2.160.0070.00720.35
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0040.00422.41
8.2.110.0090.00020.35
8.2.100.0160.00017.96
8.2.90.0000.00818.99
8.2.80.0080.00017.97
8.2.70.0030.00717.88
8.2.60.0030.00617.93
8.2.50.0110.00418.07
8.2.40.0050.00317.91
8.2.30.0090.00318.23
8.2.20.0040.00417.89
8.2.10.0040.00418.16
8.2.00.0040.00417.81
8.1.280.0110.00425.92
8.1.270.0070.00323.73
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0110.00023.80
8.1.230.0070.00419.16
8.1.220.0050.00317.79
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0080.00017.23
8.1.180.0090.00018.10
8.1.170.0030.00618.61
8.1.160.0070.00022.04
8.1.150.0030.00518.97
8.1.140.0000.00817.57
8.1.130.0030.00317.91
8.1.120.0070.00017.59
8.1.110.0030.00617.53
8.1.100.0040.00417.51
8.1.90.0070.00017.57
8.1.80.0040.00417.63
8.1.70.0030.00317.62
8.1.60.0050.00317.80
8.1.50.0070.00017.63
8.1.40.0030.00517.66
8.1.30.0040.00417.70
8.1.20.0000.00817.79
8.1.10.0040.00417.66
8.1.00.0060.00317.58
8.0.300.0050.00218.77
8.0.290.0040.00416.88
8.0.280.0020.00518.46
8.0.270.0040.00417.28
8.0.260.0030.00317.29
8.0.250.0000.00717.13
8.0.240.0000.00717.16
8.0.230.0000.00717.00
8.0.220.0080.00017.06
8.0.210.0000.00816.93
8.0.200.0000.00617.00
8.0.190.0040.00417.15
8.0.180.0060.00317.01
8.0.170.0000.00817.01
8.0.160.0050.00316.95
8.0.150.0000.00816.89
8.0.140.0040.00417.00
8.0.130.0000.00813.54
8.0.120.0040.00417.05
8.0.110.0070.00016.94
8.0.100.0040.00416.91
8.0.90.0030.00516.86
8.0.80.0120.00417.07
8.0.70.0080.00017.03
8.0.60.0000.00817.03
8.0.50.0040.00417.11
8.0.30.0140.00817.29
8.0.20.0100.01017.40
8.0.10.0040.00417.07
8.0.00.0120.00616.86
7.4.330.0020.00215.17
7.4.320.0000.00716.71
7.4.300.0000.00616.62
7.4.290.0000.00716.80
7.4.280.0040.00416.67
7.4.270.0030.00316.65
7.4.260.0000.00716.79
7.4.250.0000.00816.68
7.4.240.0020.00616.74
7.4.230.0030.00316.71
7.4.220.0060.01216.69
7.4.210.0060.00916.91
7.4.200.0070.00016.64
7.4.160.0090.00616.81
7.4.150.0150.00417.40
7.4.140.0030.01517.86
7.4.130.0050.01216.71
7.4.120.0090.00816.76
7.4.110.0060.01216.69
7.4.100.0110.01116.76
7.4.90.0140.00716.70
7.4.80.0050.01319.37
7.4.70.0030.01316.53
7.4.60.0110.00616.69
7.4.50.0080.00016.75
7.4.40.0180.00016.58
7.4.30.0130.01116.83
7.4.10.0110.00715.19
7.4.00.0050.01215.18
7.3.330.0000.00613.39
7.3.320.0080.00013.34
7.3.310.0000.00716.52
7.3.300.0070.00016.57
7.3.290.0030.01316.60
7.3.280.0090.00816.54
7.3.270.0120.01217.40
7.3.260.0090.00916.52
7.3.250.0170.00316.71
7.3.240.0150.00316.87
7.3.230.0100.01016.59
7.3.210.0060.01316.88
7.3.200.0120.00919.39
7.3.190.0070.01016.82
7.3.180.0090.00616.74
7.3.170.0070.01016.77
7.3.160.0130.00316.80
7.3.130.0100.00715.14
7.3.120.0100.00815.19
7.3.110.0080.00815.17
7.3.100.0030.01215.09
7.3.90.0060.01015.08
7.3.80.0080.00615.20
7.3.70.0090.00515.07
7.3.60.0040.01114.87
7.3.50.0040.00914.91
7.3.40.0080.00714.87
7.3.30.0070.00615.03
7.3.20.0050.00816.88
7.3.10.0070.00716.86
7.3.00.0050.01016.84
7.2.330.0100.00716.80
7.2.320.0100.01316.87
7.2.310.0070.01416.98
7.2.300.0060.01216.84
7.2.290.0070.01016.69
7.2.260.0060.01115.29
7.2.250.0090.00815.30
7.2.240.0120.00515.40
7.2.230.0040.01115.29
7.2.220.0100.00715.26
7.2.210.0050.01115.37
7.2.200.0090.00515.35
7.2.190.0050.00915.33
7.2.180.0060.00815.34
7.2.170.0040.01015.22
7.2.160.0050.01015.21
7.2.150.0050.00817.25
7.2.140.0080.00717.06
7.2.130.0050.01117.19
7.2.120.0030.00817.17
7.2.110.0050.01017.01
7.2.100.0000.01517.16
7.2.90.0070.00717.20
7.2.80.0080.00617.25
7.2.70.0050.00717.09
7.2.60.0070.00717.10
7.2.50.0100.00117.27
7.2.40.0030.01017.21
7.2.30.0000.01217.04
7.2.20.0080.00617.04
7.2.10.0020.01317.00
7.2.00.0020.01217.95
7.1.330.0070.00615.97
7.1.320.0040.00916.01
7.1.310.0090.00516.07
7.1.300.0070.00715.90
7.1.290.0070.00515.97
7.1.280.0070.00715.88
7.1.270.0050.01015.98
7.1.260.0040.01115.99
7.1.250.0050.00915.84
7.1.240.0040.00915.93
7.1.230.0090.00415.94
7.1.220.0050.00915.99
7.1.210.0060.00916.13
7.1.200.0050.00815.97
7.1.190.0040.00816.00
7.1.180.0020.01016.07
7.1.170.0030.00515.97
7.1.160.0050.00815.95
7.1.150.0030.01015.97
7.1.140.0090.00516.04
7.1.130.0050.00715.91
7.1.120.0000.01416.04
7.1.110.0030.00815.91
7.1.100.0010.01116.90
7.1.90.0060.00615.90
7.1.80.0060.00415.97
7.1.70.0030.00816.39
7.1.60.0070.00917.10
7.1.50.0040.00916.42
7.1.40.0080.00615.94
7.1.30.0050.00515.82
7.1.20.0060.00616.14
7.1.10.0070.00515.79
7.1.00.0050.02918.14
7.0.330.0070.00715.54
7.0.320.0070.00515.44
7.0.310.0090.00315.72
7.0.300.0080.00515.45
7.0.290.0030.01115.54
7.0.280.0030.00515.53
7.0.270.0040.01015.50
7.0.260.0050.00915.61
7.0.250.0040.00415.47
7.0.240.0050.00715.46
7.0.230.0020.01215.62
7.0.220.0020.00915.59
7.0.210.0040.00515.77
7.0.200.0030.00716.01
7.0.190.0060.00515.74
7.0.180.0040.01115.64
7.0.170.0030.01015.65
7.0.160.0040.00915.69
7.0.150.0070.00815.71
7.0.140.0060.02717.71
7.0.130.0070.00715.49
7.0.120.0080.00815.38
7.0.110.0060.00715.65
7.0.100.0030.00715.68
7.0.90.0060.00315.55
7.0.80.0060.03417.66
7.0.70.0050.03017.64
7.0.60.0070.02117.73
7.0.50.0040.02117.90
7.0.40.0050.03415.74
7.0.30.0040.02015.87
7.0.20.0060.03015.84
7.0.10.0080.03215.80
7.0.00.0090.02915.86
5.6.400.0050.01014.62
5.6.390.0060.00414.36
5.6.380.0070.00814.44
5.6.370.0010.01114.33
5.6.360.0090.00314.78
5.6.350.0030.00714.65
5.6.340.0070.00414.52
5.6.330.0050.00914.47
5.6.320.0070.00314.76
5.6.310.0040.00714.59
5.6.300.0050.00914.31
5.6.290.0060.00514.57
5.6.280.0070.03016.84
5.6.270.0040.01114.44
5.6.260.0050.00814.28
5.6.250.0070.00514.63
5.6.240.0080.00814.33
5.6.230.0050.03316.54
5.6.220.0070.02916.46
5.6.210.0060.03316.55
5.6.200.0090.03016.69
5.6.190.0020.02416.72
5.6.180.0070.03216.77
5.6.170.0050.03416.86
5.6.160.0080.02016.67
5.6.150.0070.02716.71
5.6.140.0000.04016.63
5.6.130.0060.03316.70
5.6.120.0080.03016.61
5.6.110.0060.02216.63
5.6.100.0060.03216.56
5.6.90.0050.03116.70
5.6.80.0040.02416.42
5.6.70.0080.03016.35
5.6.60.0040.02216.38
5.6.50.0070.03116.46
5.6.40.0030.03116.47
5.6.30.0070.02316.42
5.6.20.0090.02016.32
5.6.10.0040.03216.39
5.6.00.0030.03116.34
5.5.380.0070.00914.61
5.5.370.0070.03016.50
5.5.360.0060.03216.33
5.5.350.0110.02816.51
5.5.340.0070.03116.57
5.5.330.0050.01716.62
5.5.320.0060.01616.72
5.5.310.0080.03416.42
5.5.300.0060.03416.61
5.5.290.0110.03116.66
5.5.280.0060.02516.37
5.5.270.0080.01916.62
5.5.260.0080.02916.67
5.5.250.0050.03116.51
5.5.240.0090.02716.29
5.5.230.0060.01916.32
5.5.220.0080.02716.35
5.5.210.0060.02916.41
5.5.200.0080.01916.21
5.5.190.0040.03016.50
5.5.180.0060.03116.29
5.5.170.0050.00814.35
5.5.160.0110.03116.32
5.5.150.0080.02816.20
5.5.140.0080.02416.15
5.5.130.0070.01716.43
5.5.120.0090.01816.34
5.5.110.0060.03216.32
5.5.100.0040.02816.25
5.5.90.0050.01816.23
5.5.80.0040.03216.24
5.5.70.0030.02116.29
5.5.60.0040.03416.24
5.5.50.0060.02816.23
5.5.40.0090.02316.20
5.5.30.0040.02016.38
5.5.20.0110.02616.36
5.5.10.0050.03116.39
5.5.00.0040.03216.36
5.4.450.0060.02615.23
5.4.440.0060.02115.23
5.4.430.0010.03715.24
5.4.420.0030.03015.24
5.4.410.0030.02815.28
5.4.400.0010.03315.15
5.4.390.0090.02415.21
5.4.380.0030.01915.22
5.4.370.0030.02215.22
5.4.360.0060.02515.22
5.4.350.0030.03015.21
5.4.340.0010.03415.21
5.4.330.0010.00713.25
5.4.320.0070.02815.22
5.4.310.0060.03115.12
5.4.300.0020.03115.18
5.4.290.0060.02715.23
5.4.280.0030.02415.21
5.4.270.0050.01815.20
5.4.260.0050.02115.20
5.4.250.0020.03115.17
5.4.240.0010.03315.18
5.4.230.0080.02415.15
5.4.220.0070.01615.22
5.4.210.0040.03015.13
5.4.200.0080.02715.22
5.4.190.0030.02915.21
5.4.180.0060.02515.12
5.4.170.0040.01915.12
5.4.160.0040.02715.20
5.4.150.0060.02915.20
5.4.140.0040.02914.27
5.4.130.0040.01914.32
5.4.120.0060.02114.32
5.4.110.0080.02414.34
5.4.100.0030.02114.35
5.4.90.0050.03114.29
5.4.80.0030.02914.34
5.4.70.0060.01514.35
5.4.60.0050.02914.29
5.4.50.0040.02814.29
5.4.40.0090.01714.31
5.4.30.0030.03014.24
5.4.20.0070.01514.32
5.4.10.0020.02614.25
5.4.00.0050.03014.14
5.3.290.0030.08014.79
5.3.280.0100.03714.68
5.3.270.0130.07014.74
5.3.260.0030.07314.69
5.3.250.0070.04014.75
5.3.240.0070.07314.73
5.3.230.0070.06714.73
5.3.220.0030.07714.64
5.3.210.0000.05714.55
5.3.200.0000.05714.60
5.3.190.0030.07314.61
5.3.180.0030.04714.56
5.3.170.0030.07014.61
5.3.160.0070.04314.51
5.3.150.0000.06714.50
5.3.140.0100.07314.55
5.3.130.0070.04714.60
5.3.120.0070.06714.63
5.3.110.0100.07714.67
5.3.100.0070.05314.16
5.3.90.0100.07014.03
5.3.80.0000.05714.08
5.3.70.0070.06014.17
5.3.60.0070.05314.14
5.3.50.0200.05713.95
5.3.40.0100.06013.95
5.3.30.0070.04714.02
5.3.20.0070.07313.63
5.3.10.0100.03313.73
5.3.00.0030.04013.66
5.2.170.0070.04311.68
5.2.160.0070.03011.68
5.2.150.0130.02311.68
5.2.140.0030.03311.68
5.2.130.0100.04311.68
5.2.120.0070.03011.68
5.2.110.0100.05011.68
5.2.100.0030.03311.68
5.2.90.0070.05711.68
5.2.80.0070.05011.68
5.2.70.0030.06311.68
5.2.60.0070.05711.68
5.2.50.0000.03711.68
5.2.40.0130.02311.68
5.2.30.0030.03311.68
5.2.20.0070.03711.68
5.2.10.0030.05011.68
5.2.00.0100.05311.68
5.1.60.0070.04311.68
5.1.50.0030.04711.68
5.1.40.0030.05311.68
5.1.30.0000.05711.68
5.1.20.0030.05711.68
5.1.10.0070.05311.68
5.1.00.0030.06011.68
5.0.50.0000.05311.68
5.0.40.0030.04011.68
5.0.30.0100.06311.68
5.0.20.0000.02711.68
5.0.10.0000.03711.68
5.0.00.0000.06311.68
4.4.90.0100.01711.68
4.4.80.0030.02011.68
4.4.70.0000.04011.68
4.4.60.0000.03711.68
4.4.50.0000.03011.68
4.4.40.0000.05311.68
4.4.30.0000.03711.68
4.4.20.0000.03711.68
4.4.10.0000.02011.68
4.4.00.0070.04711.68
4.3.110.0070.01711.68
4.3.100.0000.02711.68
4.3.90.0000.02011.68
4.3.80.0000.04011.68
4.3.70.0030.03011.68
4.3.60.0000.03311.68
4.3.50.0000.03711.68
4.3.40.0000.05311.68
4.3.30.0030.03311.68
4.3.20.0030.03311.68
4.3.10.0030.02011.68
4.3.00.0030.03311.68

preferences:
49.11 ms | 401 KiB | 5 Q