3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ano = 2016; $diaSemana = 2; // terça $inicio = new DateTime($ano . '-01-01'); $fim = new DateTime($ano . '-12-31'); while ($inicio->format('w') != $diaSemana) { // anda até a primeira terça-feira do ano $inicio->modify('+1 day'); } for ($data = clone $inicio; $data <= $fim; $data->modify('+1 week')) { // itera semanalmente até o final do ano echo $data->format('Y-m-d'), PHP_EOL; // insere no banco e seja feliz }
Output for git.master, git.master_jit, rfc.property-hooks
2016-01-05 2016-01-12 2016-01-19 2016-01-26 2016-02-02 2016-02-09 2016-02-16 2016-02-23 2016-03-01 2016-03-08 2016-03-15 2016-03-22 2016-03-29 2016-04-05 2016-04-12 2016-04-19 2016-04-26 2016-05-03 2016-05-10 2016-05-17 2016-05-24 2016-05-31 2016-06-07 2016-06-14 2016-06-21 2016-06-28 2016-07-05 2016-07-12 2016-07-19 2016-07-26 2016-08-02 2016-08-09 2016-08-16 2016-08-23 2016-08-30 2016-09-06 2016-09-13 2016-09-20 2016-09-27 2016-10-04 2016-10-11 2016-10-18 2016-10-25 2016-11-01 2016-11-08 2016-11-15 2016-11-22 2016-11-29 2016-12-06 2016-12-13 2016-12-20 2016-12-27

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
43.57 ms | 402 KiB | 8 Q