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.5.30.0220.00716.82
8.5.20.0220.00717.93
8.5.10.0220.00718.19
8.5.00.0220.00918.38
8.4.180.0250.00619.47
8.4.170.0180.01020.77
8.4.160.0220.01120.81
8.4.150.0160.00617.66
8.4.140.0230.00917.29
8.4.130.0270.00717.54
8.4.120.0180.00720.94
8.4.110.0130.00820.02
8.4.100.0180.00918.41
8.4.90.0220.00619.98
8.4.80.0190.00717.62
8.4.70.0230.00717.88
8.4.60.0200.00717.74
8.4.50.0210.00717.79
8.4.40.0260.00617.78
8.4.30.0280.00617.61
8.4.20.0250.00717.67
8.4.10.0260.00517.63
8.3.300.0220.00918.52
8.3.290.0220.00819.66
8.3.280.0210.00818.37
8.3.270.0230.00816.63
8.3.260.0220.00516.57
8.3.250.0220.00917.80
8.3.240.0220.00816.75
8.3.230.0110.00516.56
8.3.220.0190.00416.83
8.3.210.0230.00516.46
8.3.200.0210.00716.36
8.3.190.0240.00616.68
8.3.180.0230.00716.35
8.3.170.0270.00616.50
8.3.160.0260.00616.48
8.3.150.0230.00716.98
8.3.140.0250.00516.48
8.3.130.0190.00616.65
8.3.120.0200.00516.90
8.3.110.0210.00417.04
8.3.100.0210.00617.26
8.3.90.0250.00617.63
8.3.80.0240.00516.63
8.3.70.0260.00716.40
8.3.60.0260.00716.59
8.3.50.0230.00517.97
8.3.40.0240.00617.77
8.3.30.0200.00617.66
8.3.20.0160.00618.36
8.3.10.0170.00818.16
8.3.00.0170.00617.92
8.2.300.0320.00819.84
8.2.290.0150.00516.43
8.2.280.0180.00716.66
8.2.270.0210.00616.50
8.2.260.0220.00616.75
8.2.250.0210.00616.43
8.2.240.0210.00716.40
8.2.230.0210.00617.15
8.2.220.0210.00518.81
8.2.210.0210.00617.47
8.2.200.0220.00516.75
8.2.190.0210.00716.43
8.2.180.0210.00616.64
8.2.170.0230.00618.29
8.2.160.0240.00518.17
8.2.150.0210.00818.28
8.2.140.0200.00618.43
8.2.130.0220.00618.58
8.2.120.0220.00617.88
8.2.110.0190.00618.99
8.2.100.0140.00718.17
8.2.90.0210.00718.02
8.2.80.0190.00718.10
8.2.70.0190.00720.45
8.2.60.0170.00619.89
8.2.50.0140.00619.80
8.2.40.0140.00519.65
8.2.30.0140.00619.81
8.2.20.0140.00519.79
8.2.10.0150.00519.82
8.2.00.0140.00519.75
8.1.340.0220.01020.54
8.1.330.0170.00515.92
8.1.320.0200.00616.17
8.1.310.0210.00616.14
8.1.300.0230.00616.14
8.1.290.0190.00616.37
8.1.280.0200.00517.18
8.1.270.0180.00618.27
8.1.260.0200.00618.67
8.1.250.0210.00517.90
8.1.240.0160.00618.13
8.1.230.0160.00718.10
8.1.220.0170.00517.78
8.1.210.0170.00718.04
8.1.200.0170.00620.24
8.1.190.0140.00519.64
8.1.180.0150.00519.55
8.1.170.0160.00419.55
8.1.160.0140.00519.70
8.1.150.0140.00519.79
8.1.140.0130.00619.60
8.1.130.0130.00619.54
8.1.120.0120.00619.55
8.1.110.0140.00519.48
8.1.100.0130.00519.30
8.1.90.0140.00519.29
8.1.80.0140.00519.25
8.1.70.0120.00618.98
8.1.60.0130.00619.16
8.1.50.0150.00519.05
8.1.40.0130.00619.00
8.1.30.0140.00519.09
8.1.20.0150.00518.99
8.1.10.0140.00518.78
8.1.00.0150.00418.73
8.0.300.0190.00517.07
8.0.290.0180.00519.79
8.0.280.0150.00619.11
8.0.270.0150.00519.06
8.0.260.0140.00619.08
8.0.250.0140.00519.04
8.0.240.0130.00618.94
8.0.230.0140.00518.85
8.0.220.0140.00518.73
8.0.210.0140.00518.68
8.0.200.0140.00518.72
8.0.190.0140.00518.64
8.0.180.0130.00518.52
8.0.170.0140.00418.38
8.0.160.0140.00518.39
8.0.150.0130.00618.26
8.0.140.0150.00418.28
8.0.130.0140.00518.15
8.0.120.0140.00518.29
8.0.110.0120.00518.25
8.0.100.0110.00518.03
8.0.90.0120.00418.07
8.0.80.0130.00418.06
8.0.70.0120.00518.10
8.0.60.0120.00518.07
8.0.50.0120.00518.04
8.0.30.0110.00517.85
8.0.20.0120.00617.73
8.0.10.0110.00717.77
8.0.00.0110.00617.94
7.4.330.0130.00418.36
7.4.320.0150.00418.73
7.4.300.0140.00418.63
7.4.290.0130.00518.45
7.4.280.0140.00518.18
7.4.270.0140.00418.19
7.4.260.0140.00518.07
7.4.250.0130.00518.11
7.4.240.0130.00518.06
7.4.230.0120.00517.89
7.4.220.0110.00417.96
7.4.210.0120.00417.76
7.4.200.0100.00517.93
7.4.190.0110.00517.85
7.4.180.0120.00517.88
7.4.160.0120.00517.67
7.4.150.0110.00617.45
7.4.140.0110.00717.38
7.4.130.0120.00617.33
7.4.120.0110.00717.28
7.4.110.0120.00617.26
7.4.100.0120.00617.25
7.4.90.0110.00717.22
7.4.80.0120.00617.23
7.4.70.0110.00717.20
7.4.60.0110.00717.17
7.4.50.0110.00717.11
7.4.40.0110.00717.06
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.89
7.3.320.0150.00517.83
7.3.310.0140.00417.86
7.3.300.0130.00417.67
7.3.290.0130.00417.63
7.3.280.0110.00517.40
7.3.270.0110.00617.24
7.3.260.0120.00617.20
7.3.250.0120.00717.18
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.04
7.3.190.0120.00717.03
7.3.180.0120.00717.03
7.3.170.0120.00716.97
7.3.160.0120.00716.94
7.3.150.0120.00716.90
7.3.140.0110.00716.83
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.71
7.3.70.0110.00716.76
7.3.60.0110.00716.79
7.3.50.0110.00716.78
7.3.40.0110.00716.78
7.3.30.0110.00716.79
7.3.20.0130.00717.14
7.3.10.0130.00717.11
7.3.00.0130.00717.12
7.2.340.0140.00717.20
7.2.330.0140.00717.18
7.2.320.0150.00717.16
7.2.310.0150.00717.13
7.2.300.0140.00817.11
7.2.290.0140.00717.04
7.2.280.0130.00816.99
7.2.270.0130.00816.95
7.2.260.0130.00816.89
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.84
7.2.200.0140.00816.90
7.2.190.0130.00816.90
7.2.180.0140.00716.89
7.2.170.0130.00716.92
7.2.160.0130.00816.95
7.2.150.0140.00817.37
7.2.140.0150.00817.36
7.2.130.0150.00817.39
7.2.120.0150.00717.37
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.35
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.39
7.2.10.0140.00817.42
7.2.00.0130.00817.39

preferences:
45.85 ms | 1534 KiB | 5 Q