3v4l.org

run code in 300+ PHP versions simultaneously
<?php // 請填入本平台提供的 txid 值並填入在單引號內 $txid = 'c19db6709526fe662bf574f886ca22b3a1d44d8a1001ea815c5aceae48e013ff'; // 總共幾個大賞 $prize_count = 20; // 總共幾個籤數 $tag_count = 250; $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.00.0190.01016.80
8.4.150.0310.01219.88
8.4.140.0370.00517.69
8.4.130.0420.00717.86
8.4.120.0380.01017.89
8.4.110.0410.00618.14
8.4.100.0390.00917.87
8.4.90.0400.01118.23
8.4.80.0370.00718.01
8.4.70.0340.01118.03
8.4.60.0340.01218.07
8.4.50.0360.01217.86
8.4.40.0400.00817.69
8.4.30.0380.00817.84
8.4.20.0440.00717.82
8.4.10.0410.00818.01
8.3.280.0290.01018.61
8.3.270.0360.00717.01
8.3.260.0360.00616.96
8.3.250.0350.01116.65
8.3.240.0370.00917.02
8.3.230.0340.00916.96
8.3.220.0380.00616.99
8.3.210.0370.00816.74
8.3.200.0390.00816.86
8.3.190.0330.01017.02
8.3.180.0340.01016.98
8.3.170.0350.01116.87
8.3.160.0340.01216.68
8.3.150.0390.00616.72
8.3.140.0410.00717.04
8.3.130.0330.00816.96
8.3.120.0330.00716.96
8.3.110.0340.00616.79
8.3.100.0360.01016.95
8.3.90.0440.01216.69
8.3.80.0420.00516.67
8.3.70.0400.00916.77
8.3.60.0380.00816.77
8.3.50.0390.00816.81
8.3.40.0380.00717.93
8.3.30.0270.00817.92
8.3.20.0270.00918.22
8.3.10.0300.00717.98
8.3.00.0280.00718.20
8.2.290.0250.01116.90
8.2.280.0310.00816.80
8.2.270.0310.00716.89
8.2.260.0280.01017.04
8.2.250.0300.00716.65
8.2.240.0300.00916.43
8.2.230.0310.00716.66
8.2.220.0300.00716.78
8.2.210.0320.01016.49
8.2.200.0290.01216.58
8.2.190.0290.00916.67
8.2.180.0290.01016.55
8.2.170.0270.01018.20
8.2.160.0340.00418.15
8.2.150.0270.01018.32
8.2.140.0310.01018.04
8.2.130.0320.00818.25
8.2.120.0280.01117.98
8.2.110.0320.00918.20
8.2.100.0300.00718.26
8.2.90.0280.00918.16
8.2.80.0290.00818.01
8.2.70.0350.00517.96
8.2.60.0290.01218.14
8.2.50.0310.00918.05
8.2.40.0310.00718.18
8.2.30.0280.00918.21
8.2.20.0330.00618.17
8.2.10.0290.01217.94
8.2.00.0350.01318.15

preferences:
32.12 ms | 408 KiB | 5 Q