3v4l.org

run code in 300+ PHP versions simultaneously
<?php // 請代入本平台提供的 hash 值並填入在單引號內 $txid = '799746d145f88f3d5514b40844e076cf1bcde7d1b167993a26ac7a641446e85d'; // 總共幾個大賞 $prize_count = 13; // 總共幾個籤數 $tag_count = 350; $dec = gmp_init($txid, 16); $prize_tmp = []; $prize_tmp_count = 0; $step_tmp = 100; $step = 1; $max_count = 100; try { while ($step <= $max_count) { $powResult = gmp_pow($step_tmp, $step); $div = gmp_div_q($dec, $powResult); $mod = gmp_mod($div, $tag_count); $prize_number = (int)gmp_strval($mod) + 1; if (!in_array($prize_number, $prize_tmp)) { $prize_tmp[] = $prize_number; $prize_tmp_count++; } if ($prize_tmp_count >= $prize_count) { break; } $step++; } echo implode(', ', $prize_tmp); } catch (\Exception $e) { echo $e->getMessage(); }

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.0090.01122.67
8.4.110.0140.00522.50
8.4.100.0200.01118.78
8.4.90.0270.00818.41
8.4.80.0200.00518.22
8.4.70.0150.00718.25
8.4.60.0200.00818.13
8.4.50.0140.00818.31
8.4.40.0190.01017.88
8.4.30.0150.00418.09
8.4.20.0220.00519.06
8.4.10.0230.00718.78
8.3.250.0090.01019.13
8.3.240.0100.01017.28
8.3.230.0260.00616.66
8.3.220.0150.00717.72
8.3.210.0150.00617.50
8.3.200.0210.00516.95
8.3.190.0290.00617.09
8.3.180.0250.00616.94
8.3.170.0260.00818.14
8.3.160.0260.00616.77
8.3.150.0220.00817.07
8.3.140.0230.00717.09
8.3.130.0250.00617.03
8.3.120.0210.00517.03
8.3.110.0210.00717.08
8.3.100.0190.00819.90
8.3.90.0220.00517.55
8.3.80.0220.00618.09
8.3.70.0190.00617.93
8.3.60.0210.00616.72
8.3.50.0220.00519.34
8.3.40.0220.00520.12
8.3.30.0210.00518.98
8.3.20.0220.00618.96
8.3.10.0180.00517.62
8.3.00.0160.00618.24
8.2.290.0200.01018.65
8.2.280.0280.00916.92
8.2.270.0250.01017.05
8.2.260.0240.00617.04
8.2.250.0130.00416.83
8.2.240.0140.00617.10
8.2.230.0180.00517.12
8.2.220.0170.00517.05
8.2.210.0180.00217.52
8.2.200.0180.00517.81
8.2.190.0180.00617.80
8.2.180.0180.00816.55
8.2.170.0220.00617.86
8.2.160.0230.00817.73
8.2.150.0270.00617.85
8.2.140.0220.00817.76
8.2.130.0230.00717.64
8.2.120.0240.00817.81
8.2.110.0260.00717.87
8.2.100.0230.00717.74
8.2.90.0230.00617.79
8.2.80.0210.00717.53
8.2.70.0230.00617.58
8.2.60.0220.00617.64
8.2.50.0240.00617.63
8.2.40.0250.00517.61
8.2.30.0210.00617.62
8.2.20.0220.00717.53
8.2.10.0220.00817.60
8.2.00.0250.00617.53
8.1.330.0220.00919.04
8.1.320.0230.00617.09
8.1.310.0220.00516.45
8.1.300.0190.00616.44
8.1.290.0200.00817.45
8.1.280.0220.00716.43
8.1.270.0210.00717.44
8.1.260.0210.00518.51
8.1.250.0240.00517.55
8.1.240.0200.00617.52
8.1.230.0220.00517.37
8.1.220.0200.00717.44
8.1.210.0220.00517.33
8.1.200.0220.00517.31
8.1.190.0210.00517.23
8.1.180.0170.00817.24
8.1.170.0190.00717.53
8.1.160.0230.00617.37
8.1.150.0200.00518.37
8.1.140.0220.00717.47
8.1.130.0210.00717.38
8.1.120.0190.00817.47
8.1.110.0220.00517.37
8.1.100.0250.00517.21
8.1.90.0210.00817.38
8.1.80.0240.00517.38
8.1.70.0230.00518.82
8.1.60.0270.00517.45
8.1.50.0240.00817.54
8.1.40.0160.00821.96
8.1.30.0210.00719.27
8.1.20.0230.00617.50
8.1.10.0220.00517.60
8.1.00.0230.00517.19

preferences:
27.41 ms | 403 KiB | 5 Q