3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bijective { /** * * @var string */ private $dictionary = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; /** * CTOR */ public function __construct() { $this->dictionary = str_split($this->dictionary); } /** * * @param int $i * @return string */ public function encode($i) { if ($i == 0) return $this->dictionary[0]; $result = ''; $base = count($this->dictionary); while ($i > 0) { $result[] = $this->dictionary[($i % $base)]; $i = floor($i / $base); } $result = array_reverse($result); return join("", $result); } /** * * @param string $input * @return int */ public function decode($input) { $i = 0; $base = count($this->dictionary); $input = str_split($input); foreach ($input as $char) { $pos = array_search($char, $this->dictionary); $i = $i * $base + $pos; } return $i; } } $b=new Bijective(); echo $b->decode('d5iskrr');

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.0110.00716.50
8.3.50.0120.01022.11
8.3.40.0110.00418.58
8.3.30.0100.01019.13
8.3.20.0000.00720.29
8.3.10.0080.00023.63
8.3.00.0040.00420.76
8.2.180.0040.01118.41
8.2.170.0100.00722.96
8.2.160.0090.00622.13
8.2.150.0100.01024.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0080.00022.25
8.2.110.0060.00320.39
8.2.100.0070.00417.71
8.2.90.0060.00319.17
8.2.80.0040.00417.97
8.2.70.0050.00317.50
8.2.60.0030.00617.93
8.2.50.0080.00018.07
8.2.40.0040.00418.28
8.2.30.0040.00418.04
8.2.20.0060.00317.54
8.2.10.0000.00819.40
8.2.00.0030.00517.63
8.1.280.0090.00625.92
8.1.270.0080.00023.91
8.1.260.0080.00026.35
8.1.250.0090.00628.09
8.1.240.0070.00322.14
8.1.230.0000.01122.11
8.1.220.0000.00817.74
8.1.210.0000.01018.77
8.1.200.0030.00617.35
8.1.190.0000.00817.65
8.1.180.0000.00818.10
8.1.170.0000.00918.51
8.1.160.0000.01022.02
8.1.150.0050.00218.64
8.1.140.0000.00817.50
8.1.130.0040.00417.84
8.1.120.0000.00717.48
8.1.110.0040.00417.46
8.1.100.0050.00517.49
8.1.90.0000.00817.50
8.1.80.0030.00317.52
8.1.70.0070.00017.44
8.1.60.0030.00617.60
8.1.50.0080.00017.47
8.1.40.0000.00817.43
8.1.30.0050.00317.60
8.1.20.0000.00817.66
8.1.10.0060.00317.60
8.1.00.0000.00817.57
8.0.300.0000.00718.77
8.0.290.0030.00517.18
8.0.280.0000.00818.45
8.0.270.0050.00317.27
8.0.260.0000.00616.76
8.0.250.0040.00417.04
8.0.240.0030.00516.98
8.0.230.0070.00017.03
8.0.220.0030.00316.97
8.0.210.0000.00716.88
8.0.200.0060.00017.01
8.0.190.0050.00316.94
8.0.180.0030.00316.82
8.0.170.0000.00716.91
8.0.160.0040.00416.88
8.0.150.0050.00316.84
8.0.140.0000.00716.88
8.0.130.0000.00513.30
8.0.120.0080.00016.84
8.0.110.0080.00016.93
8.0.100.0000.00716.78
8.0.90.0040.00416.91
8.0.80.0060.00916.89
8.0.70.0070.00016.78
8.0.60.0000.00716.74
8.0.50.0040.00416.86
8.0.30.0090.01017.17
8.0.20.0110.00717.40
8.0.10.0040.00417.09
8.0.00.0100.00717.00
7.4.330.0000.00515.03
7.4.320.0000.00716.52
7.4.300.0060.00016.55
7.4.290.0040.00416.52
7.4.280.0040.00416.43
7.4.270.0000.00716.61
7.4.260.0070.00016.64
7.4.250.0000.00716.48
7.4.240.0020.00516.55
7.4.230.0030.00316.50
7.4.220.0100.00716.57
7.4.210.0080.00716.59
7.4.200.0040.00416.60
7.4.190.0000.00716.56
7.4.160.0130.00316.64
7.4.150.0030.01517.40
7.4.140.0110.00717.86
7.4.130.0110.00816.68
7.4.120.0120.00916.49
7.4.110.0090.00916.55
7.4.100.0090.00916.58
7.4.90.0070.01116.46
7.4.80.0030.01616.51
7.4.70.0140.00316.65
7.4.60.0070.01016.49
7.4.50.0050.00516.36
7.4.40.0070.00722.77
7.4.30.0140.00316.46
7.4.00.0100.00714.97
7.3.330.0030.00513.29
7.3.320.0050.00013.33
7.3.310.0050.00316.22
7.3.300.0030.00316.34
7.3.290.0120.00316.34
7.3.280.0050.01116.32
7.3.270.0110.00617.40
7.3.260.0090.00916.62
7.3.250.0090.00816.47
7.3.240.0160.00016.71
7.3.230.0080.00516.59
7.3.210.0140.00316.56
7.3.200.0100.01419.39
7.3.190.0130.00716.57
7.3.180.0090.00916.35
7.3.170.0090.00916.52
7.3.160.0100.01016.63
7.3.120.0080.00014.90
7.3.00.0070.00716.73
7.2.330.0130.00416.60
7.2.320.0030.01416.49
7.2.310.0090.00616.84
7.2.300.0170.00316.52
7.2.290.0080.00816.76
7.2.130.0030.00917.14
7.2.120.0030.00717.04
7.2.110.0070.00717.03
7.2.100.0050.00517.11
7.2.90.0090.00616.94
7.2.80.0100.00317.20
7.2.70.0100.00617.21
7.2.60.0070.01017.00
7.2.50.0030.01416.95
7.2.40.0080.00817.00
7.2.30.0160.01016.82
7.2.20.0090.00616.79
7.2.10.0060.00617.11
7.2.00.0080.00718.27
7.1.250.0000.01315.82
7.1.240.0040.01215.76
7.1.230.0000.00915.70
7.1.220.0050.00915.59
7.1.210.0030.01015.48
7.1.200.0000.01115.87
7.1.190.0000.00915.87
7.1.180.0000.00915.89
7.1.170.0060.00915.69
7.1.160.0060.00315.87
7.1.150.0070.01015.87
7.1.140.0060.00615.97
7.1.130.0040.01115.57
7.1.120.0070.00715.89
7.1.110.0100.00315.56
7.1.100.0060.00917.15
7.1.90.0000.01115.71
7.1.80.0040.01115.85
7.1.70.0040.00616.63
7.1.60.0060.01117.58
7.1.50.0140.00516.48
7.1.40.0100.00715.99
7.1.30.0040.00415.81
7.1.20.0000.01115.39
7.1.10.0030.00615.79
7.1.00.0030.04319.17
7.0.330.0070.00715.37
7.0.320.0000.01115.28
7.0.310.0040.01115.39
7.0.300.0000.00815.07
7.0.290.0040.01115.44
7.0.280.0080.00815.33
7.0.270.0050.00815.24
7.0.260.0040.00814.90
7.0.250.0000.01315.31
7.0.240.0100.00315.40
7.0.230.0030.00615.01
7.0.220.0000.01215.37
7.0.210.0070.00715.45
7.0.200.1270.01015.11
7.0.190.0030.01215.02
7.0.180.0030.01315.53
7.0.170.0040.01115.51
7.0.160.0000.01215.22
7.0.150.0020.00615.30
7.0.140.0050.04118.46
7.0.130.0090.00615.41
7.0.120.0070.01015.20
7.0.110.0030.00715.36
7.0.100.0140.04017.71
7.0.90.0280.02817.65
7.0.80.0220.04217.60
7.0.70.0310.03817.63
7.0.60.0380.03017.59
7.0.50.0350.03917.85
7.0.40.0120.04116.61
7.0.30.0040.03416.54
7.0.20.0020.03016.78
7.0.10.0070.03916.72
7.0.00.0070.04716.63
5.6.380.0060.00314.50
5.6.370.0070.01014.53
5.6.360.0040.01114.20
5.6.350.0140.00314.54
5.6.340.0130.00014.40
5.6.330.0040.00714.30
5.6.320.0100.00313.99
5.6.310.0040.01114.34
5.6.300.0040.01214.56
5.6.290.0030.00614.02
5.6.280.0030.04217.58
5.6.270.0040.00814.50
5.6.260.0100.00314.11
5.6.250.0070.04517.30
5.6.240.0060.04317.43
5.6.230.0070.04317.57
5.6.220.0090.03917.33
5.6.210.0030.04817.32
5.6.200.0050.04717.76
5.6.190.0120.04117.71
5.6.180.0080.04317.61
5.6.170.0050.04817.71
5.6.160.0020.04017.55
5.6.150.0090.02717.63
5.6.140.0070.04617.70
5.6.130.0160.03617.62
5.6.120.0070.03617.69
5.6.110.0080.04117.71
5.6.100.0100.02217.59
5.6.90.0120.04117.65
5.6.80.0050.04217.35
5.6.70.0090.04017.28
5.6.60.0100.02217.49
5.6.50.0050.04417.39
5.6.40.0090.04117.26
5.6.30.0050.04417.24
5.6.20.0060.04117.28
5.6.10.0090.04017.40
5.6.00.0070.02717.20
5.5.380.0070.04315.70
5.5.370.0020.04915.64
5.5.360.0070.03915.91
5.5.350.0050.04015.82
5.5.340.0030.04616.16
5.5.330.0110.04415.97
5.5.320.0100.04315.92
5.5.310.0040.04215.97
5.5.300.0090.04216.06
5.5.290.0020.04716.02
5.5.280.0050.04216.05
5.5.270.0070.04516.05
5.5.260.0030.04415.84
5.5.250.0060.04115.65
5.5.240.0020.02815.63
5.5.230.0030.04015.67
5.5.220.0050.04315.55
5.5.210.0050.02515.71
5.5.200.0090.02615.52
5.5.190.0070.04015.52
5.5.180.0120.03415.57
5.5.170.0060.00610.90
5.5.160.0080.03515.70
5.5.150.0050.04315.59
5.5.140.0050.04315.73
5.5.130.0100.03715.60
5.5.120.0140.03015.69
5.5.110.0080.03815.58
5.5.100.0070.04015.59
5.5.90.0020.04315.48
5.5.80.0060.02615.49
5.5.70.0090.04115.47
5.5.60.0080.04015.58
5.5.50.0060.03815.53
5.5.40.0060.04115.61
5.5.30.0060.04415.44
5.5.20.0080.04315.63
5.5.10.0090.04015.53
5.5.00.0080.03015.48
5.4.450.0030.04715.23
5.4.440.0050.03415.10
5.4.430.0040.04115.12
5.4.420.0050.02015.05
5.4.410.0040.02415.21
5.4.400.0080.04014.89
5.4.390.0030.04114.88
5.4.380.0120.03015.04
5.4.370.0080.03615.03
5.4.360.0020.04315.07
5.4.350.0080.02215.05
5.4.340.0170.01715.03
5.4.330.0080.00410.90
5.4.320.0070.04115.05
5.4.310.0080.04015.03
5.4.300.0150.02215.09
5.4.290.0050.04515.07
5.4.280.0100.02414.98
5.4.270.0060.03715.06
5.4.260.0040.04315.10
5.4.250.0110.03214.87
5.4.240.0070.03015.06
5.4.230.0080.04014.94
5.4.220.0030.04115.18
5.4.210.0050.04215.05
5.4.200.0050.04315.04
5.4.190.0050.04015.19
5.4.180.0080.03915.00
5.4.170.0050.04314.89
5.4.160.0020.04614.99
5.4.150.0100.03514.95
5.4.140.0050.02813.69
5.4.130.0120.03313.68
5.4.120.0020.03213.82
5.4.110.0050.03813.82
5.4.100.0030.04113.73
5.4.90.0050.04013.68
5.4.80.0070.02913.71
5.4.70.0070.03813.63
5.4.60.0090.03113.72
5.4.50.0030.03013.64
5.4.40.0020.02913.78
5.4.30.0060.03813.78
5.4.20.0080.02513.70
5.4.10.0050.02513.66
5.4.00.0060.03713.33
5.3.290.0070.03812.75
5.3.280.0020.02912.74
5.3.270.0130.02812.79
5.3.260.0060.03912.75
5.3.250.0130.03512.80
5.3.240.0030.03612.75
5.3.230.0120.03212.75
5.3.220.0050.04112.72
5.3.210.0080.03812.75
5.3.200.0010.02312.79
5.3.190.0050.03812.77
5.3.180.0050.04512.81
5.3.170.0030.04012.80
5.3.160.0050.02712.75
5.3.150.0060.02812.79
5.3.140.0080.02512.75
5.3.130.0070.03512.79
5.3.120.0080.03712.74
5.3.110.0030.03112.72
5.3.100.0050.04112.46
5.3.90.0050.03412.47
5.3.80.0050.03812.44
5.3.70.0050.03912.41
5.3.60.0020.02712.52
5.3.50.0030.02312.42
5.3.40.0030.04012.49
5.3.30.0100.03712.37
5.3.20.0030.02112.36
5.3.10.0030.04012.23
5.3.00.0090.03412.29
5.2.170.0010.02111.32
5.2.160.0030.03211.32
5.2.150.0030.03311.32
5.2.140.0030.02511.32
5.2.130.0100.02811.32
5.2.120.0050.03311.32
5.2.110.0070.02711.32
5.2.100.0050.02711.32
5.2.90.0030.02911.32
5.2.80.0070.02711.32
5.2.70.0080.03011.32
5.2.60.0050.03411.32
5.2.50.0070.03211.32
5.2.40.0050.02411.32
5.2.30.0070.03311.32
5.2.20.0030.03011.32
5.2.10.0020.03511.32
5.2.00.0000.02711.32
5.1.60.0070.01611.32
5.1.50.0050.01211.32
5.1.40.0030.01511.32
5.1.30.0030.01611.32
5.1.20.0050.01911.32
5.1.10.0020.01811.32
5.1.00.0030.01511.32
5.0.50.0030.01011.32
5.0.40.0020.01211.32
5.0.30.0020.01711.32
5.0.20.0020.01211.32
5.0.10.0000.01411.32
5.0.00.0020.01811.32
4.4.90.0000.02211.32
4.4.80.0020.01211.32
4.4.70.0030.01211.32
4.4.60.0030.01811.32
4.4.50.0020.02211.32
4.4.40.0000.01611.32
4.4.30.0050.00711.32
4.4.20.0000.01011.32
4.4.10.0010.01111.32
4.4.00.0010.01311.32
4.3.110.0000.01211.32
4.3.100.0040.01011.32
4.3.90.0000.01011.32
4.3.80.0020.01311.32
4.3.70.0030.01011.32
4.3.60.0000.01011.32
4.3.50.0030.00711.32
4.3.40.0030.01111.32
4.3.30.0000.01211.32
4.3.20.0000.01111.32
4.3.10.0020.01311.32
4.3.00.0020.01711.32

preferences:
48.25 ms | 401 KiB | 5 Q