3v4l.org

run code in 300+ PHP versions simultaneously
<?php $period_start = '2016-01-01 00:00:00'; $period_end = '2016-01-31 23:59:59'; $uptime = []; $incidents = [ ['start' => '2016-01-05 00:00:00', 'end' => '2016-01-10 23:59:59'], ['start' => '2016-01-07 00:00:00', 'end' => '2016-01-15 23:59:59'], ['start' => '2016-01-20 00:00:00', 'end' => '2016-01-25 23:59:59'], ['start' => '2016-01-23 00:00:00', 'end' => '2016-01-24 23:59:59'] ]; if(strtotime($period_start) <= strtotime($incidents[0]['start'])) { array_push($uptime,['start' => $period_start, 'end' => $incidents[0]['start']]); } for($i=0;$i<sizeof($incidents);$i++) { if($incident[$i+1]) { if(strtotime($incident[$i]['end']) > strtotime($incident[$i+1]['start'])) { echo "sap"; } } } if(strtotime($period_end) >= strtotime($incidents[sizeof($incidents)-1]['end'])) { array_push($uptime,['start' => $incidents[0]['end'], 'end' => $period_end]); } print_r( $uptime );
Output for git.master, git.master_jit
Warning: Undefined variable $incident in /in/XkoJW on line 20 Warning: Trying to access array offset on value of type null in /in/XkoJW on line 20 Warning: Undefined variable $incident in /in/XkoJW on line 20 Warning: Trying to access array offset on value of type null in /in/XkoJW on line 20 Warning: Undefined variable $incident in /in/XkoJW on line 20 Warning: Trying to access array offset on value of type null in /in/XkoJW on line 20 Warning: Undefined variable $incident in /in/XkoJW on line 20 Warning: Trying to access array offset on value of type null in /in/XkoJW on line 20 Array ( [0] => Array ( [start] => 2016-01-01 00:00:00 [end] => 2016-01-05 00:00:00 ) [1] => Array ( [start] => 2016-01-10 23:59:59 [end] => 2016-01-31 23:59:59 ) )
Output for rfc.property-hooks
Warning: Undefined variable $incident in /in/XkoJW on line 20 Warning: Trying to access array offset on null in /in/XkoJW on line 20 Warning: Undefined variable $incident in /in/XkoJW on line 20 Warning: Trying to access array offset on null in /in/XkoJW on line 20 Warning: Undefined variable $incident in /in/XkoJW on line 20 Warning: Trying to access array offset on null in /in/XkoJW on line 20 Warning: Undefined variable $incident in /in/XkoJW on line 20 Warning: Trying to access array offset on null in /in/XkoJW on line 20 Array ( [0] => Array ( [start] => 2016-01-01 00:00:00 [end] => 2016-01-05 00:00:00 ) [1] => Array ( [start] => 2016-01-10 23:59:59 [end] => 2016-01-31 23:59:59 ) )

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:
65.87 ms | 402 KiB | 8 Q