3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json='[{"from":"2019-07-22 09:00:00","to":"2019-07-22 11:00:00","rendering":"background","resource":"3529","backgroundColor":"#660000","purpose":"Close"},{"from":"2019-07-22 07:00:00","to":"2019-07-22 08:00:00","rendering":"background","resource":"3529","backgroundColor":"#660000","purpose":"Close"},{"from":"2019-07-22 07:00:00","to":"2019-07-22 08:00:00","rendering":"background","resource":"3529","backgroundColor":"#660000","purpose":"Open"},{"from":"2019-07-22 20:00:00","to":"2019-07-22 22:00:00","rendering":"background","resource":"3529","backgroundColor":"#660000","purpose":"Open"},{"from":"2019-07-22 11:00:00","to":"2019-07-22 17:00:00","rendering":"background","resource":"3529","backgroundColor":"#660000","purpose":"Open"},{"from":"2019-07-22 20:00:00","to":"2019-07-22 22:00:00","rendering":"background","resource":"3529","backgroundColor":"#660000","purpose":"Close"},{"from":"2019-07-22 07:00:00","to":"2019-07-22 15:00:00","rendering":"background","resource":"3529","backgroundColor":"#660000","purpose":"Close"}]'; //var_export(json_decode($json, true)); foreach (json_decode($json, true) as $i => $entry) { if (!$i) { $result[] = $entry; } else { foreach ($result as $stored) { if (($entry['from'] >= $stored['from'] && $entry['from'] < $stored['to']) || ($entry['to'] > $stored['from'] && $entry['to'] <= $stored['to'])) { continue 2; } } $result[] = $entry; } } var_export($result);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 'from' => '2019-07-22 09:00:00', 'to' => '2019-07-22 11:00:00', 'rendering' => 'background', 'resource' => '3529', 'backgroundColor' => '#660000', 'purpose' => 'Close', ), 1 => array ( 'from' => '2019-07-22 07:00:00', 'to' => '2019-07-22 08:00:00', 'rendering' => 'background', 'resource' => '3529', 'backgroundColor' => '#660000', 'purpose' => 'Close', ), 2 => array ( 'from' => '2019-07-22 20:00:00', 'to' => '2019-07-22 22:00:00', 'rendering' => 'background', 'resource' => '3529', 'backgroundColor' => '#660000', 'purpose' => 'Open', ), 3 => array ( 'from' => '2019-07-22 11:00:00', 'to' => '2019-07-22 17:00:00', 'rendering' => 'background', 'resource' => '3529', 'backgroundColor' => '#660000', 'purpose' => 'Open', ), )

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:
116.9 ms | 407 KiB | 5 Q