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.120.0060.00319.07
8.3.110.0240.00818.95
8.3.100.0130.01127.69
8.3.90.0190.00721.75
8.3.80.0170.01123.84
8.3.70.0160.00523.71
8.3.60.0240.00016.51
8.3.50.0230.00525.30
8.3.40.0280.00724.87
8.3.30.0260.00323.68
8.3.20.0220.00523.68
8.3.10.0150.00617.67
8.3.00.0180.01817.36
8.2.240.0040.00419.21
8.2.230.0140.01419.57
8.2.220.0120.00817.87
8.2.210.0150.00221.59
8.2.200.0190.00223.77
8.2.190.0120.00723.78
8.2.180.0140.00516.44
8.2.170.0210.00317.96
8.2.160.0250.00417.83
8.2.150.0250.00917.87
8.2.140.0150.00517.75
8.2.130.0220.00717.38
8.2.120.0220.00717.47
8.2.110.0380.00817.70
8.2.100.0300.01117.61
8.2.90.0370.01117.55
8.2.80.0370.00717.54
8.2.70.0270.01017.66
8.2.60.0290.01317.60
8.2.50.0310.01017.65
8.2.40.0320.00717.63
8.2.30.0310.00817.51
8.2.20.0240.01717.56
8.2.10.0320.00817.64
8.2.00.0310.00717.66
8.1.300.0090.00616.90
8.1.290.0210.00823.44
8.1.280.0390.00716.29
8.1.270.0340.00817.41
8.1.260.0240.00521.82
8.1.250.0340.00317.12
8.1.240.0280.00317.37
8.1.230.0310.00417.20
8.1.220.0240.00717.46
8.1.210.0130.00517.39
8.1.200.0180.01217.36
8.1.190.0160.00817.32
8.1.180.0080.00817.38
8.1.170.0180.00417.50
8.1.160.0280.00717.15
8.1.150.0160.00621.87
8.1.140.0300.00717.51
8.1.130.0210.01717.48
8.1.120.0250.01317.55
8.1.110.0240.00917.49
8.1.100.0400.00017.46
8.1.90.0180.02317.42
8.1.80.0300.00717.52
8.1.70.0220.00523.69
8.1.60.0340.00717.48
8.1.50.0310.01417.41
8.1.40.0140.00824.88
8.1.30.0160.00626.36
8.1.20.0140.00517.61
8.1.10.0140.00517.54
8.1.00.0190.00017.34

preferences:
27.99 ms | 403 KiB | 5 Q