3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_POST = [ "start_shift1" => "09:00", "end_shift1" => "17:00", "break1" => "02:30" ]; if(isset($_POST['start_shift1']) && $_POST['end_shift1'] && $_POST['break1'] != "") { $datetime1 = new DateTime($_POST['start_shift1']); $datetime2 = new DateTime($_POST['end_shift1']); list($h, $m) = explode(":", $_POST['break1']); $break = new DateInterval("PT{$h}H{$m}M"); $mondiff = $datetime1->add($break)->diff($datetime2); ?> <input type="text" readonly class="form-control" name="monday" value="<?php echo $mondiff->format('%H:%I'); ?>"> <?php } ?>
Output for git.master, git.master_jit, rfc.property-hooks
<input type="text" readonly class="form-control" name="monday" value="05:30">

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:
31.23 ms | 401 KiB | 8 Q