3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * Fill in all five below and click blue 'eval();' button below textarea. * * ------------------ */ $caseNumber = -1; $unhashedServerSeed = ''; $nonce = -1; $clientSeed = ''; $qty = -1; /* ------------------ */ if ($caseNumber < 0 || $unhashedServerSeed == '' || $nonce < 0 || $clientSeed == '' || $qty < 0) { echo "Fill in details"; return; } $unhashedServerSeed = preg_replace( "/\r|\n/", "", $unhashedServerSeed ); $clientSeed = preg_replace( "/\r|\n/", "", $clientSeed ); function calculatePreResult($init, $depth, $numIterations = 0, $hash = null) { if ($numIterations === $depth) { return $hash; } if ($numIterations === 0) { $hash = $init; } return calculatePreResult($init, $depth, $numIterations + 1, hash('sha256', $hash)); } $preResult = calculatePreResult("$unhashedServerSeed-$clientSeed-$caseNumber-$nonce", 1000); $preResultAsInt = hexdec(substr(bin2hex($preResult), 0, 8)); $result = ($preResultAsInt % $qty) + 1; echo "Pre-Result: $preResult / $preResultAsInt\n"; echo "Result: $result";

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.4.120.0140.00624.14
8.4.110.0080.01222.14
8.4.100.0160.00918.58
8.4.90.0190.00720.40
8.4.80.0180.00617.61
8.4.70.0230.00717.93
8.4.60.0200.00717.72
8.4.50.0210.00717.83
8.4.40.0260.00617.81
8.4.30.0280.00617.66
8.4.20.0250.00717.70
8.4.10.0270.00617.63
8.3.250.0120.00619.00
8.3.240.0120.00816.99
8.3.230.0060.00516.55
8.3.220.0160.00416.86
8.3.210.0210.00516.44
8.3.200.0200.00616.36
8.3.190.0230.00616.69
8.3.180.0220.00616.34
8.3.170.0250.00516.48
8.3.160.0250.00616.46
8.3.150.0230.00717.01
8.3.140.0260.00516.44
8.3.130.0190.00616.66
8.3.120.0200.00616.97
8.3.110.0220.00417.07
8.3.100.0210.00617.32
8.3.90.0240.00517.75
8.3.80.0230.00516.65
8.3.70.0250.00616.37
8.3.60.0240.00716.62
8.3.50.0210.00518.13
8.3.40.0230.00517.77
8.3.30.0190.00517.65
8.3.20.0150.00518.41
8.3.10.0170.00718.20
8.3.00.0150.00617.92
8.2.290.0120.00516.40
8.2.280.0170.00716.68
8.2.270.0200.00616.48
8.2.260.0210.00616.77
8.2.250.0200.00616.44
8.2.240.0210.00716.38
8.2.230.0200.00617.24
8.2.220.0200.00519.09
8.2.210.0200.00517.63
8.2.200.0210.00516.79
8.2.190.0190.00716.46
8.2.180.0210.00516.67
8.2.170.0220.00618.32
8.2.160.0230.00518.20
8.2.150.0200.00818.34
8.2.140.0190.00618.52
8.2.130.0200.00518.67
8.2.120.0210.00617.89
8.2.110.0180.00519.07
8.2.100.0130.00718.18
8.2.90.0210.00718.03
8.2.80.0190.00718.11
8.2.70.0180.00720.56
8.2.60.0170.00519.97
8.2.50.0140.00619.86
8.2.40.0140.00519.70
8.2.30.0140.00619.87
8.2.20.0140.00519.87
8.2.10.0140.00519.88
8.2.00.0130.00519.82
8.1.330.0130.00415.89
8.1.320.0190.00616.19
8.1.310.0200.00616.17
8.1.300.0230.00616.13
8.1.290.0190.00616.39
8.1.280.0190.00517.31
8.1.270.0170.00618.35
8.1.260.0180.00618.80
8.1.250.0200.00517.95
8.1.240.0160.00618.16
8.1.230.0160.00718.13
8.1.220.0170.00517.78
8.1.210.0160.00618.07
8.1.200.0170.00520.36
8.1.190.0140.00519.71
8.1.180.0140.00519.61
8.1.170.0150.00419.61
8.1.160.0140.00519.77
8.1.150.0140.00519.86
8.1.140.0130.00619.66
8.1.130.0130.00619.60
8.1.120.0120.00619.60
8.1.110.0130.00519.54
8.1.100.0130.00519.34
8.1.90.0140.00519.33
8.1.80.0140.00519.29
8.1.70.0120.00519.01
8.1.60.0130.00619.19
8.1.50.0150.00519.08
8.1.40.0130.00619.02
8.1.30.0140.00519.11
8.1.20.0140.00519.01
8.1.10.0140.00518.80
8.1.00.0150.00418.76
8.0.300.0190.00517.07
8.0.290.0180.00519.92
8.0.280.0150.00619.18
8.0.270.0150.00519.12
8.0.260.0140.00519.15
8.0.250.0140.00419.10
8.0.240.0130.00618.99
8.0.230.0130.00518.90
8.0.220.0140.00518.78
8.0.210.0130.00518.72
8.0.200.0130.00518.76
8.0.190.0140.00518.68
8.0.180.0130.00518.55
8.0.170.0140.00418.41
8.0.160.0140.00518.42
8.0.150.0130.00618.29
8.0.140.0150.00418.30
8.0.130.0140.00518.17
8.0.120.0140.00518.32
8.0.110.0120.00518.27
8.0.100.0110.00518.05
8.0.90.0120.00418.09
8.0.80.0130.00418.08
8.0.70.0120.00518.13
8.0.60.0120.00518.09
8.0.50.0110.00518.05
8.0.30.0110.00517.86
8.0.20.0120.00617.74
8.0.10.0110.00717.78
8.0.00.0110.00617.95
7.4.330.0130.00418.40
7.4.320.0150.00418.78
7.4.300.0140.00418.68
7.4.290.0130.00518.48
7.4.280.0140.00518.21
7.4.270.0140.00418.21
7.4.260.0140.00518.10
7.4.250.0130.00518.13
7.4.240.0130.00518.09
7.4.230.0120.00417.91
7.4.220.0110.00417.98
7.4.210.0120.00417.77
7.4.200.0100.00517.95
7.4.190.0110.00517.87
7.4.180.0120.00517.90
7.4.160.0110.00517.68
7.4.150.0110.00617.46
7.4.140.0110.00717.39
7.4.130.0110.00617.34
7.4.120.0110.00717.29
7.4.110.0120.00617.27
7.4.100.0110.00617.25
7.4.90.0110.00717.22
7.4.80.0120.00617.24
7.4.70.0110.00717.20
7.4.60.0110.00717.18
7.4.50.0110.00717.11
7.4.40.0110.00717.07
7.4.30.0110.00717.02
7.4.20.0110.00716.96
7.4.10.0100.00716.91
7.4.00.0100.00716.92
7.3.330.0140.00517.92
7.3.320.0140.00517.86
7.3.310.0140.00417.89
7.3.300.0130.00417.68
7.3.290.0130.00417.64
7.3.280.0110.00517.42
7.3.270.0110.00617.25
7.3.260.0120.00617.21
7.3.250.0120.00717.19
7.3.240.0120.00717.15
7.3.230.0120.00617.12
7.3.220.0130.00617.08
7.3.210.0120.00617.07
7.3.200.0120.00617.05
7.3.190.0120.00717.03
7.3.180.0120.00717.03
7.3.170.0120.00716.98
7.3.160.0120.00716.94
7.3.150.0120.00716.90
7.3.140.0110.00716.84
7.3.130.0120.00716.77
7.3.120.0110.00716.73
7.3.110.0110.00716.69
7.3.100.0110.00716.71
7.3.90.0120.00716.81
7.3.80.0120.00716.72
7.3.70.0110.00716.76
7.3.60.0110.00716.79
7.3.50.0110.00816.79
7.3.40.0110.00716.78
7.3.30.0110.00716.79
7.3.20.0130.00717.13
7.3.10.0130.00717.11
7.3.00.0130.00717.12
7.2.340.0150.00717.21
7.2.330.0140.00717.18
7.2.320.0150.00717.16
7.2.310.0150.00717.13
7.2.300.0140.00817.12
7.2.290.0140.00717.04
7.2.280.0130.00817.00
7.2.270.0130.00816.95
7.2.260.0130.00816.90
7.2.250.0130.00816.85
7.2.240.0130.00716.84
7.2.230.0130.00816.86
7.2.220.0130.00816.85
7.2.210.0130.00716.85
7.2.200.0140.00816.90
7.2.190.0130.00816.90
7.2.180.0130.00716.90
7.2.170.0130.00716.92
7.2.160.0130.00816.95
7.2.150.0140.00817.36
7.2.140.0150.00817.35
7.2.130.0150.00817.39
7.2.120.0150.00717.36
7.2.110.0160.00717.36
7.2.100.0150.00817.36
7.2.90.0150.00817.34
7.2.80.0140.00817.35
7.2.70.0140.00817.34
7.2.60.0130.00817.34
7.2.50.0140.00817.33
7.2.40.0140.00817.38
7.2.30.0140.00817.38
7.2.20.0150.00817.38
7.2.10.0140.00817.41
7.2.00.0130.00817.38
7.1.330.0110.00515.11
7.1.320.0120.00415.01
7.1.310.0140.00215.14
7.1.300.0130.00215.18
7.1.290.0130.00315.23
7.1.280.0110.00415.20
7.1.270.0110.00415.28
7.1.260.0120.00415.08
7.1.250.0130.00315.14
7.1.240.0110.00415.09
7.1.230.0120.00415.10
7.1.220.0110.00415.36
7.1.210.0220.00515.13
7.1.200.0220.00415.36
7.1.190.0130.00315.31
7.1.180.0120.00315.23
7.1.170.0130.00215.12
7.1.160.0130.00215.09
7.1.150.0130.00315.09
7.1.140.0120.00215.27
7.1.130.0100.00515.06
7.1.120.0120.00415.16
7.1.110.0130.00315.26
7.1.100.0120.00315.16
7.1.90.0120.00315.06
7.1.80.0130.00115.09
7.1.70.0120.00315.10
7.1.60.0140.00115.11
7.1.50.0150.00315.08
7.1.40.0140.00415.05
7.1.30.0130.00315.09
7.1.20.0110.00415.10
7.1.10.0140.00414.92
7.1.00.0130.00315.05
7.0.330.0350.00514.95
7.0.320.0200.00314.84
7.0.310.0120.00314.84
7.0.300.0110.00414.84
7.0.290.0140.00214.84
7.0.280.0130.00314.88
7.0.270.0130.00414.89
7.0.260.0130.00314.84
7.0.250.0100.00415.08
7.0.240.0120.00414.97
7.0.230.0120.00214.89
7.0.220.0120.00315.09
7.0.210.0110.00315.02
7.0.200.0120.00315.08
7.0.190.0110.00414.94
7.0.180.0130.00414.95
7.0.170.0120.00314.96
7.0.160.0120.00314.96
7.0.150.0120.00414.84
7.0.140.0120.00414.95
7.0.130.0110.00415.05
7.0.120.0110.00414.95
7.0.110.0180.00514.84
7.0.100.0250.00314.84
7.0.90.0110.00414.90
7.0.80.0110.00314.84
7.0.70.0110.00414.84
7.0.60.0110.00314.84
7.0.50.0120.00314.93
7.0.40.0120.00414.84
7.0.30.0120.00314.91
7.0.20.0110.00414.92
7.0.10.0120.00214.96
7.0.00.0110.00214.84
5.6.400.0110.00515.68
5.6.390.0090.00415.57
5.6.380.0110.00315.56
5.6.370.0130.00315.44
5.6.360.0110.00415.61
5.6.350.0120.00315.73
5.6.340.0120.00315.63
5.6.330.0100.00415.59
5.6.320.0110.00315.29
5.6.310.0120.00315.80
5.6.300.0110.00215.49
5.6.290.0100.00315.52
5.6.280.0100.00415.59
5.6.270.0130.00215.78
5.6.260.0100.00315.77
5.6.250.0120.00215.59
5.6.240.0110.00315.63
5.6.230.0110.00315.83
5.6.220.0090.00515.81
5.6.210.0100.00315.71
5.6.200.0130.00115.80
5.6.190.0120.00215.81
5.6.180.0120.00315.48
5.6.170.0110.00315.71
5.6.160.0110.00415.60
5.6.150.0100.00415.65
5.6.140.0110.00315.63
5.6.130.0110.00315.58
5.6.120.0110.00215.72
5.6.110.0090.00515.69
5.6.100.0110.00215.68
5.6.90.0120.00215.48
5.6.80.0090.00515.60
5.6.70.0100.00315.66
5.6.60.0110.00215.74
5.6.50.0100.00315.68
5.6.40.0110.00215.58
5.6.30.0100.00415.76
5.6.20.0080.00415.68
5.6.10.0080.00515.69
5.6.00.0110.00215.64
5.5.380.0110.00315.46
5.5.370.0100.00315.76
5.5.360.0110.00415.67
5.5.350.0110.00415.56
5.5.340.0130.00315.56
5.5.330.0130.00215.50
5.5.320.0100.00315.42
5.5.310.0110.00415.52
5.5.300.0110.00315.67
5.5.290.0100.00415.67
5.5.280.0100.00515.52
5.5.270.0100.00415.44
5.5.260.0100.00415.44
5.5.250.0110.00215.64
5.5.240.0100.00315.65
5.5.230.0130.00315.64
5.5.220.0110.00215.53
5.5.210.0110.00115.74
5.5.200.0110.00215.47
5.5.190.0090.00415.29
5.5.180.0090.00415.30
5.5.170.0110.00315.36
5.5.160.0090.00515.30
5.5.150.0100.00315.31
5.5.140.0080.00515.42
5.5.130.0100.00315.30
5.5.120.0130.00315.36
5.5.110.0110.00315.05
5.5.100.0090.00315.53
5.5.90.0110.00315.73
5.5.80.0110.00215.60
5.5.70.0100.00315.44
5.5.60.0110.00315.41
5.5.50.0100.00515.53
5.5.40.0120.00215.57
5.5.30.0110.00215.57
5.5.20.0100.00315.72
5.5.10.0110.00215.61
5.5.00.0100.00215.64
5.4.450.0100.00114.84
5.4.440.0090.00114.84
5.4.430.0080.00214.84
5.4.420.0090.00214.84
5.4.410.0080.00314.84
5.4.400.0090.00214.84
5.4.390.0090.00214.84
5.4.380.0070.00314.84
5.4.370.0090.00214.84
5.4.360.0070.00314.84
5.4.350.0100.00214.84
5.4.340.0080.00314.84
5.4.330.0080.00314.84
5.4.320.0090.00214.84
5.4.310.0100.00114.84
5.4.300.0090.00214.84
5.4.290.0090.00214.84
5.4.280.0090.00114.84
5.4.270.0080.00214.84
5.4.260.0090.00314.84
5.4.250.0080.00214.84
5.4.240.0090.00114.84
5.4.230.0080.00214.84
5.4.220.0090.00114.84
5.4.210.0070.00314.84
5.4.200.0080.00314.84
5.4.190.0080.00314.84
5.4.180.0080.00414.84
5.4.170.0070.00414.84
5.4.160.0100.00214.84
5.4.150.0080.00214.84
5.4.140.0070.00314.84
5.4.130.0060.00314.84
5.4.120.0080.00214.84
5.4.110.0090.00214.84
5.4.100.0090.00214.84
5.4.90.0070.00314.84
5.4.80.0080.00214.84
5.4.70.0080.00214.84
5.4.60.0070.00314.84
5.4.50.0090.00114.84
5.4.40.0080.00314.84
5.4.30.0060.00414.84
5.4.20.0060.00414.84
5.4.10.0090.00214.84
5.4.00.0060.00514.84
5.3.290.0080.00414.84
5.3.280.0080.00314.84
5.3.270.0100.00114.84
5.3.260.0090.00114.84
5.3.250.0090.00214.84
5.3.240.0060.00414.84
5.3.230.0070.00414.84
5.3.220.0090.00314.84
5.3.210.0080.00314.84
5.3.200.0090.00214.84
5.3.190.0060.00414.84
5.3.180.0080.00314.84
5.3.170.0080.00414.84
5.3.160.0090.00214.84
5.3.150.0080.00214.84
5.3.140.0080.00314.84
5.3.130.0080.00214.84
5.3.120.0080.00214.84
5.3.110.0070.00414.84
5.3.100.0060.00314.84
5.3.90.0080.00214.84
5.3.80.0090.00114.84
5.3.70.0090.00314.84
5.3.60.0090.00314.84
5.3.50.0080.00214.84
5.3.40.0080.00314.84
5.3.30.0080.00214.84
5.3.20.0080.00214.84
5.3.10.0080.00214.84
5.3.00.0080.00214.84
5.2.170.0060.00314.84
5.2.160.0060.00314.84
5.2.150.0070.00114.84
5.2.140.0060.00314.84
5.2.130.0080.00214.84
5.2.120.0070.00214.84
5.2.110.0070.00214.84
5.2.100.0060.00214.84
5.2.90.0060.00214.84
5.2.80.0080.00314.84
5.2.70.0070.00214.84
5.2.60.0070.00114.84
5.2.50.0050.00414.84
5.2.40.0070.00214.84
5.2.30.0070.00214.84
5.2.20.0050.00314.84
5.2.10.0060.00214.84
5.2.00.0050.00214.84
5.1.60.0050.00314.84
5.1.50.0060.00214.84
5.1.40.0070.00114.84
5.1.30.0070.00114.84
5.1.20.0040.00414.84
5.1.10.0060.00214.84
5.1.00.0060.00214.84
5.0.50.0050.00114.84
5.0.40.0050.00214.84
5.0.30.0060.00114.84
5.0.20.0060.00214.84
5.0.10.0050.00114.84
5.0.00.0050.00114.84
4.4.90.0030.00114.84
4.4.80.0030.00114.84
4.4.70.0030.00014.84
4.4.60.0030.00114.84
4.4.50.0030.00014.84
4.4.40.0030.00014.84
4.4.30.0040.00014.84
4.4.20.0040.00014.84
4.4.10.0030.00114.84
4.4.00.0040.00014.84
4.3.110.0030.00114.84
4.3.100.0040.00014.84
4.3.90.0030.00014.84
4.3.80.0030.00014.84
4.3.70.0020.00114.84
4.3.60.0040.00014.84
4.3.50.0030.00014.84
4.3.40.0020.00114.84
4.3.30.0030.00014.84
4.3.20.0020.00114.84
4.3.10.0020.00014.84
4.3.00.0030.00014.84

preferences:
31.38 ms | 403 KiB | 5 Q