3v4l.org

run code in 500+ 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.0270.00616.76
8.5.20.0270.00617.44
8.5.10.0250.00717.68
8.5.00.0260.00917.78
8.4.180.0280.00819.50
8.4.170.0210.01120.32
8.4.160.0260.01020.39
8.4.150.0220.00618.12
8.4.140.0270.00817.45
8.4.130.0290.00817.46
8.4.120.0240.00819.87
8.4.110.0200.00819.25
8.4.100.0210.00918.28
8.4.90.0240.00619.67
8.4.80.0210.00817.64
8.4.70.0240.00717.87
8.4.60.0210.00617.75
8.4.50.0220.00717.78
8.4.40.0270.00717.75
8.4.30.0290.00617.60
8.4.20.0260.00717.66
8.4.10.0260.00617.63
8.3.300.0260.00918.45
8.3.290.0270.00819.24
8.3.280.0280.00718.34
8.3.270.0280.00716.67
8.3.260.0260.00616.60
8.3.250.0260.00917.43
8.3.240.0270.00916.66
8.3.230.0140.00616.56
8.3.220.0210.00516.78
8.3.210.0240.00616.48
8.3.200.0230.00716.40
8.3.190.0250.00716.69
8.3.180.0250.00716.37
8.3.170.0280.00616.50
8.3.160.0260.00716.49
8.3.150.0240.00816.94
8.3.140.0260.00616.50
8.3.130.0200.00616.67
8.3.120.0190.00516.88
8.3.110.0200.00417.01
8.3.100.0210.00617.21
8.3.90.0240.00517.53
8.3.80.0250.00616.62
8.3.70.0270.00716.43
8.3.60.0260.00716.56
8.3.50.0240.00617.86
8.3.40.0250.00617.78
8.3.30.0210.00617.68
8.3.20.0170.00618.31
8.3.10.0180.00818.14
8.3.00.0170.00617.90
8.2.300.0350.00819.26
8.2.290.0170.00616.43
8.2.280.0190.00716.65
8.2.270.0210.00716.50
8.2.260.0230.00616.74
8.2.250.0220.00616.43
8.2.240.0220.00716.39
8.2.230.0210.00717.08
8.2.220.0220.00618.58
8.2.210.0210.00617.37
8.2.200.0220.00516.71
8.2.190.0200.00716.44
8.2.180.0220.00616.64
8.2.170.0240.00618.26
8.2.160.0240.00518.15
8.2.150.0220.00818.25
8.2.140.0210.00618.38
8.2.130.0220.00618.49
8.2.120.0220.00617.88
8.2.110.0200.00618.92
8.2.100.0140.00718.16
8.2.90.0220.00718.01
8.2.80.0200.00718.07
8.2.70.0190.00720.33
8.2.60.0180.00619.83
8.2.50.0150.00619.75
8.2.40.0140.00519.60
8.2.30.0140.00619.75
8.2.20.0150.00519.74
8.2.10.0150.00519.76
8.2.00.0140.00519.70
8.1.340.0260.00919.56
8.1.330.0190.00515.98
8.1.320.0210.00716.16
8.1.310.0220.00716.14
8.1.300.0240.00616.14
8.1.290.0200.00616.35
8.1.280.0210.00617.07
8.1.270.0200.00618.22
8.1.260.0200.00618.57
8.1.250.0210.00517.88
8.1.240.0170.00618.09
8.1.230.0170.00718.07
8.1.220.0170.00517.77
8.1.210.0170.00718.02
8.1.200.0170.00620.13
8.1.190.0150.00619.57
8.1.180.0150.00519.49
8.1.170.0160.00519.50
8.1.160.0150.00519.64
8.1.150.0150.00519.73
8.1.140.0140.00619.54
8.1.130.0130.00619.49
8.1.120.0130.00619.50
8.1.110.0140.00519.44
8.1.100.0140.00519.26
8.1.90.0140.00519.25
8.1.80.0140.00519.21
8.1.70.0130.00618.96
8.1.60.0140.00619.13
8.1.50.0150.00519.02
8.1.40.0140.00618.98
8.1.30.0150.00519.06
8.1.20.0150.00518.96
8.1.10.0150.00518.76
8.1.00.0150.00418.71
8.0.300.0200.00517.07
8.0.290.0180.00519.67
8.0.280.0150.00619.05
8.0.270.0150.00518.99
8.0.260.0140.00619.03
8.0.250.0140.00518.99
8.0.240.0140.00618.89
8.0.230.0140.00518.81
8.0.220.0140.00518.69
8.0.210.0140.00518.64
8.0.200.0140.00518.67
8.0.190.0140.00518.61
8.0.180.0130.00518.49
8.0.170.0140.00418.35
8.0.160.0140.00518.37
8.0.150.0130.00618.24
8.0.140.0150.00418.25
8.0.130.0140.00518.13
8.0.120.0140.00518.26
8.0.110.0120.00518.23
8.0.100.0120.00518.01
8.0.90.0120.00418.05
8.0.80.0130.00418.04
8.0.70.0120.00518.09
8.0.60.0120.00518.05
8.0.50.0120.00518.02
8.0.30.0120.00517.84
8.0.20.0120.00617.72
8.0.10.0120.00717.76
8.0.00.0120.00717.93
7.4.330.0130.00418.32
7.4.320.0160.00418.68
7.4.300.0140.00418.59
7.4.290.0130.00518.41
7.4.280.0140.00518.15
7.4.270.0140.00418.16
7.4.260.0140.00518.05
7.4.250.0130.00518.08
7.4.240.0130.00518.03
7.4.230.0120.00517.87
7.4.220.0110.00417.93
7.4.210.0120.00417.74
7.4.200.0110.00517.92
7.4.190.0110.00517.83
7.4.180.0120.00517.86
7.4.160.0120.00517.65
7.4.150.0110.00617.45
7.4.140.0110.00717.38
7.4.130.0120.00617.32
7.4.120.0120.00717.27
7.4.110.0120.00617.26
7.4.100.0120.00617.24
7.4.90.0110.00717.21
7.4.80.0120.00617.22
7.4.70.0110.00717.19
7.4.60.0110.00717.17
7.4.50.0120.00717.10
7.4.40.0110.00717.06
7.4.30.0110.00717.01
7.4.20.0110.00716.96
7.4.10.0110.00716.91
7.4.00.0110.00716.92
7.3.330.0140.00517.86
7.3.320.0150.00517.80
7.3.310.0150.00417.83
7.3.300.0130.00417.64
7.3.290.0130.00417.61
7.3.280.0110.00517.39
7.3.270.0110.00617.23
7.3.260.0120.00617.19
7.3.250.0120.00717.17
7.3.240.0120.00717.14
7.3.230.0120.00617.11
7.3.220.0130.00617.07
7.3.210.0120.00617.06
7.3.200.0130.00617.04
7.3.190.0120.00717.02
7.3.180.0120.00717.02
7.3.170.0120.00716.97
7.3.160.0120.00716.93
7.3.150.0120.00716.89
7.3.140.0120.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.70
7.3.90.0120.00716.81
7.3.80.0120.00716.71
7.3.70.0120.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.15
7.3.10.0130.00717.12
7.3.00.0130.00717.13
7.2.340.0150.00717.19
7.2.330.0140.00717.17
7.2.320.0150.00717.15
7.2.310.0150.00717.12
7.2.300.0140.00817.11
7.2.290.0140.00717.03
7.2.280.0130.00816.99
7.2.270.0130.00816.95
7.2.260.0130.00816.89
7.2.250.0130.00816.84
7.2.240.0130.00716.84
7.2.230.0130.00816.85
7.2.220.0130.00816.84
7.2.210.0130.00716.84
7.2.200.0140.00816.89
7.2.190.0130.00816.90
7.2.180.0140.00716.89
7.2.170.0130.00716.91
7.2.160.0130.00816.95
7.2.150.0140.00817.37
7.2.140.0150.00817.37
7.2.130.0150.00817.40
7.2.120.0150.00717.37
7.2.110.0160.00717.37
7.2.100.0150.00817.37
7.2.90.0150.00817.35
7.2.80.0140.00817.36
7.2.70.0140.00817.35
7.2.60.0130.00817.35
7.2.50.0140.00817.34
7.2.40.0140.00817.39
7.2.30.0140.00817.39
7.2.20.0150.00817.39
7.2.10.0140.00817.42
7.2.00.0130.00817.40

preferences:
45.75 ms | 1519 KiB | 5 Q