3v4l.org

run code in 300+ PHP versions simultaneously
<?php // 請填入本平台提供的 txid 值並填入在單引號內 $txid = 'a04777905226d613ac663988d4568f54438b338a3260f6c20ad7b9e432a2d483'; // 總共幾個大賞 $prize_count = 1; // 總共幾個籤數 $tag_count = 70; $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.5.10.0130.00616.68
8.5.00.0130.01320.33
8.4.160.0140.00824.16
8.4.150.0020.00114.05
8.4.140.0110.01017.79
8.4.130.0140.00718.01
8.4.120.0100.01022.21
8.4.110.0110.00822.76
8.4.100.0140.00617.71
8.4.90.0090.00919.74
8.4.80.0190.00819.71
8.4.70.0170.00919.48
8.4.60.0280.00417.76
8.4.50.0270.00417.88
8.4.40.0240.00817.57
8.4.30.0570.01017.50
8.4.20.0430.01117.69
8.4.10.0430.01017.93
8.3.280.0100.01018.66
8.3.270.0100.01016.82
8.3.260.0100.00916.75
8.3.250.0110.00819.08
8.3.240.0120.00716.94
8.3.230.0130.01017.04
8.3.220.0190.00716.97
8.3.210.0100.00516.97
8.3.200.0390.00916.97
8.3.190.0350.00916.97
8.3.180.0390.00816.97
8.3.170.0480.00716.97
8.3.160.0380.00816.97
8.3.150.0300.00316.97
8.3.140.0420.00716.97
8.3.130.0300.01017.02
8.3.120.0320.00916.97
8.3.110.0360.00816.97
8.3.100.0390.01216.97
8.3.90.0410.01016.97
8.3.80.0460.00816.97
8.3.70.0210.00518.61
8.3.60.0200.00316.97
8.3.50.0180.00516.97
8.3.40.0180.00517.57
8.3.30.0390.00717.61
8.3.20.0360.00717.64
8.3.10.0300.01017.78
8.3.00.0280.00817.86
8.2.290.0110.00719.14
8.2.280.0280.01016.97
8.2.270.0370.00516.97
8.2.260.0320.01116.97
8.2.250.0290.00816.97
8.2.240.0360.00716.97
8.2.230.0310.00716.97
8.2.220.0350.00716.97
8.2.210.0330.01116.97
8.2.200.0310.00816.97
8.2.190.0320.00716.97
8.2.180.0330.01016.97
8.2.170.0310.01617.72
8.2.160.0360.00417.66
8.2.150.0130.00717.78
8.2.140.0370.00817.62
8.2.130.0340.00917.56
8.2.120.0340.01117.73
8.2.110.0370.00617.91
8.2.100.0340.00317.68
8.2.90.0400.00617.62
8.2.80.0410.00517.52
8.2.70.0290.01017.48
8.2.60.0430.01017.59
8.2.50.0340.00817.75
8.2.40.0320.01217.75
8.2.30.0340.00717.73
8.2.20.0320.00817.60
8.2.10.0290.00817.79
8.2.00.0340.00617.57

preferences:
33.53 ms | 403 KiB | 5 Q