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.3.110.0120.00620.94
8.3.100.0050.01131.24
8.3.90.0040.00426.77
8.3.80.0120.01030.84
8.3.70.0160.00330.84
8.3.50.0230.00728.12
8.3.40.0310.00826.77
8.3.30.0290.00526.77
8.3.20.0240.00826.77
8.2.230.0030.00722.58
8.2.220.0100.00718.19
8.2.210.0080.00026.77
8.2.200.0170.00030.84
8.2.190.0040.00430.84
8.1.290.0090.00030.84
8.1.260.0130.00724.06
8.1.150.0100.00524.06
8.1.70.0150.00726.77
8.1.40.0130.00826.32
8.1.30.0130.00730.84
8.0.140.0200.00917.70
7.4.230.0150.01017.35

preferences:
29.75 ms | 403 KiB | 5 Q