3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ym = date('Y-m-'); $derived_table = ''; for ($d = 1, $end = date('t'); $d <= $end; ++$d) { $date = $ym . str_pad($d, 2, 0, STR_PAD_LEFT); if ($d == 1) { $derived_table .= "SELECT '$date' AS event_date_start"; } else { $derived_table .= " UNION SELECT '$date'"; } } echo $derived_table;
Output for git.master, git.master_jit, rfc.property-hooks
SELECT '2021-05-01' AS event_date_start UNION SELECT '2021-05-02' UNION SELECT '2021-05-03' UNION SELECT '2021-05-04' UNION SELECT '2021-05-05' UNION SELECT '2021-05-06' UNION SELECT '2021-05-07' UNION SELECT '2021-05-08' UNION SELECT '2021-05-09' UNION SELECT '2021-05-10' UNION SELECT '2021-05-11' UNION SELECT '2021-05-12' UNION SELECT '2021-05-13' UNION SELECT '2021-05-14' UNION SELECT '2021-05-15' UNION SELECT '2021-05-16' UNION SELECT '2021-05-17' UNION SELECT '2021-05-18' UNION SELECT '2021-05-19' UNION SELECT '2021-05-20' UNION SELECT '2021-05-21' UNION SELECT '2021-05-22' UNION SELECT '2021-05-23' UNION SELECT '2021-05-24' UNION SELECT '2021-05-25' UNION SELECT '2021-05-26' UNION SELECT '2021-05-27' UNION SELECT '2021-05-28' UNION SELECT '2021-05-29' UNION SELECT '2021-05-30' UNION SELECT '2021-05-31'

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:
95.03 ms | 407 KiB | 5 Q