3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); date_default_timezone_set('America/New_York'); $day = strtolower(date('D')); $current_time = date('Hi'); $day = 'mon'; $current_time = '1630'; $liveshows = [ 'mon' => [ ['start' => '0600', 'end' => '0900', 'host' => 'Joe'], ['start' => '1300', 'end' => '1500', 'host' => 'Carol'], ['start' => '1500', 'end' => '1600', 'host' => 'Cortez'], ['start' => '1700', 'end' => '2100', 'host' => 'Boy George'], ], ]; if ($day === 'mon' && !empty($liveshows['mon'])) { $isIsOnAir = false; foreach ($liveshows['mon'] as $showtime) { if ($showtime['start'] <= $current_time && $current_time <= $showtime['end']) { $isIsOnAir = true; echo '<h3>', $showtime['host'], ' <span>is on air</span></h3>'; break; } } if (!$isIsOnAir) { echo '<h3>No live show is on</h3>'; foreach ($liveshows['mon'] as $showtime) { if ($current_time < $showtime['start']) { echo '<p>The next live show is at ', date('g:iA', strtotime($showtime['start'])), '</p>'; break; } } } }
Output for git.master, git.master_jit, rfc.property-hooks
<h3>No live show is on</h3><p>The next live show is at 5:00PM</p>

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:
25.93 ms | 405 KiB | 5 Q