3v4l.org

run code in 300+ PHP versions simultaneously
<?php function date_generator($ex_weeks = array(), $ex_DateTimeObjects = array()) { $kanji_w = array('日', '月', '火', '水', '木', '金', '土'); $current = new DateTime('now', new DateTimezone('Asia/Tokyo')); for ($i = 0; $i < 30; $i++) { $current->add(new DateInterval('P1D')); if ($i < 2 || in_array($current->format('w'), $ex_weeks)) { continue; } foreach ($ex_DateTimeObjects as $object) { if (!$object->diff($current)->days) { continue 2; } } $w = $kanji_w[$current->format(' (w)')]; yield $current->format('n月j日') . $w; } } ?> <select name="date"> <?php foreach (date_generator(array(1), array(new DateTime('12/25'))) as $value): ?> <option value="<?=$value?>"><?=$value?></option> <?php endforeach; ?> </select>
Output for git.master, git.master_jit, rfc.property-hooks
<select name="date"> Warning: Undefined array key " (4)" in /in/ntPVH on line 16 <option value="12月19日">12月19日</option> Warning: Undefined array key " (5)" in /in/ntPVH on line 16 <option value="12月20日">12月20日</option> Warning: Undefined array key " (6)" in /in/ntPVH on line 16 <option value="12月21日">12月21日</option> Warning: Undefined array key " (0)" in /in/ntPVH on line 16 <option value="12月22日">12月22日</option> Warning: Undefined array key " (4)" in /in/ntPVH on line 16 <option value="12月26日">12月26日</option> Warning: Undefined array key " (5)" in /in/ntPVH on line 16 <option value="12月27日">12月27日</option> Warning: Undefined array key " (6)" in /in/ntPVH on line 16 <option value="12月28日">12月28日</option> Warning: Undefined array key " (0)" in /in/ntPVH on line 16 <option value="12月29日">12月29日</option> Warning: Undefined array key " (2)" in /in/ntPVH on line 16 <option value="12月31日">12月31日</option> Warning: Undefined array key " (3)" in /in/ntPVH on line 16 <option value="1月1日">1月1日</option> Warning: Undefined array key " (4)" in /in/ntPVH on line 16 <option value="1月2日">1月2日</option> Warning: Undefined array key " (5)" in /in/ntPVH on line 16 <option value="1月3日">1月3日</option> Warning: Undefined array key " (6)" in /in/ntPVH on line 16 <option value="1月4日">1月4日</option> Warning: Undefined array key " (0)" in /in/ntPVH on line 16 <option value="1月5日">1月5日</option> Warning: Undefined array key " (2)" in /in/ntPVH on line 16 <option value="1月7日">1月7日</option> Warning: Undefined array key " (3)" in /in/ntPVH on line 16 <option value="1月8日">1月8日</option> Warning: Undefined array key " (4)" in /in/ntPVH on line 16 <option value="1月9日">1月9日</option> Warning: Undefined array key " (5)" in /in/ntPVH on line 16 <option value="1月10日">1月10日</option> Warning: Undefined array key " (6)" in /in/ntPVH on line 16 <option value="1月11日">1月11日</option> Warning: Undefined array key " (0)" in /in/ntPVH on line 16 <option value="1月12日">1月12日</option> Warning: Undefined array key " (2)" in /in/ntPVH on line 16 <option value="1月14日">1月14日</option> Warning: Undefined array key " (3)" in /in/ntPVH on line 16 <option value="1月15日">1月15日</option> </select>

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:
45.19 ms | 409 KiB | 8 Q