3v4l.org

run code in 300+ PHP versions simultaneously
<?php $iX0 = date_create('01-11-2019 08:00'); //Start interval X $iX1 = date_create('01-11-2019 14:00'); //End interval X $iY0 = date_create('01-11-2019 12:00'); //Start interval Y $iY1 = date_create('01-11-2019 17:00'); //End interval Y $i0 = MAX($iX0,$iY0); $i1 = Min($iX1,$iY1); if($i1 >= $i0){ $diff = $i0->diff($i1); echo $diff->h." Hours"; //full Hours } else { echo 'no itersect'; }
Output for git.master, git.master_jit, rfc.property-hooks
2 Hours

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