3v4l.org

run code in 300+ PHP versions simultaneously
<?php // suppose this is your mysql data, each inner pair is a 'to', 'from' $rows = array( array(1,6), array(7,10), array(8,12) ); list($a, $b) = current($rows); $downtime = $b - $a; while( list($c, $d) = next($rows) ) { $downtime += $d - $c - max(0, min($d,$b)-$c); if( $c >= $b ) $a = $c; $b = max($b,$d); } echo "total down time is " , $downtime; ?>
Output for git.master, git.master_jit, rfc.property-hooks
total down time is 10

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