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.20.0060.00321.68
8.4.10.0190.00719.33
8.3.140.0190.00617.01
8.3.130.0220.00617.08
8.3.120.0200.00517.06
8.3.110.0200.00717.12
8.3.100.0190.00920.41
8.3.90.0220.00517.72
8.3.80.0230.00718.32
8.3.70.0190.00618.16
8.3.60.0190.00616.71
8.3.50.0220.00419.76
8.3.40.0210.00520.55
8.3.30.0190.00519.20
8.3.20.0200.00619.23
8.3.10.0160.00517.59
8.3.00.0120.00518.40
8.2.260.0180.00417.05
8.2.250.0110.00416.84
8.2.240.0110.00617.17
8.2.230.0170.00517.20
8.2.220.0160.00517.07
8.2.210.0160.00217.70
8.2.200.0160.00418.05
8.2.190.0140.00617.99
8.2.180.0140.00816.50
8.2.170.0210.00617.84
8.2.160.0210.00717.71
8.2.150.0240.00617.86
8.2.140.0190.00717.81
8.2.130.0220.00717.65
8.2.120.0210.00817.84
8.2.110.0240.00717.90
8.2.100.0220.00717.70
8.2.90.0210.00617.78
8.2.80.0200.00717.53
8.2.70.0220.00517.53
8.2.60.0220.00617.63
8.2.50.0220.00617.64
8.2.40.0220.00517.58
8.2.30.0180.00617.60
8.2.20.0180.00717.52
8.2.10.0210.00717.58
8.2.00.0230.00517.51
8.1.310.0270.00516.24
8.1.300.0170.00616.45
8.1.290.0180.00817.62
8.1.280.0200.00716.40
8.1.270.0210.00717.40
8.1.260.0220.00518.70
8.1.250.0230.00617.56
8.1.240.0200.00617.54
8.1.230.0210.00417.32
8.1.220.0170.00717.45
8.1.210.0190.00417.30
8.1.200.0190.00417.30
8.1.190.0180.00517.21
8.1.180.0140.00817.23
8.1.170.0170.00717.53
8.1.160.0210.00517.35
8.1.150.0180.00518.56
8.1.140.0200.00617.51
8.1.130.0190.00717.37
8.1.120.0190.00717.42
8.1.110.0210.00417.38
8.1.100.0240.00417.23
8.1.90.0220.00717.32
8.1.80.0220.00617.37
8.1.70.0210.00419.09
8.1.60.0250.00417.46
8.1.50.0220.00817.38
8.1.40.0140.00823.20
8.1.30.0190.00719.90
8.1.20.0210.00617.44
8.1.10.0210.00517.64
8.1.00.0230.00417.18

preferences:
31.28 ms | 403 KiB | 5 Q