3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ ['DTSTART' => '2017-01-02', 'SUMMARY;LANGUAGE=en' => 'Non-recyclable waste'], ['DTSTART' => '2017-01-03', 'SUMMARY;LANGUAGE=en' => 'Bio-waste'], ['DTSTART' => '2017-01-04', 'SUMMARY;LANGUAGE=en' => 'Junk'], ]; $finalDate = '2038-12-31'; $result = []; foreach ($arr as $value) { if ($value['DTSTART'] > $finalDate) { continue; } $result[] = [ 'day' => $value['DTSTART'], 'type' => $value['SUMMARY;LANGUAGE=en'], ...match($value['SUMMARY;LANGUAGE=en']) { 'Non-recyclable waste', 'Bio-waste' => ['color' => 'success'], default => [] } ]; } var_export($result);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 'day' => '2017-01-02', 'type' => 'Non-recyclable waste', 'color' => 'success', ), 1 => array ( 'day' => '2017-01-03', 'type' => 'Bio-waste', 'color' => 'success', ), 2 => array ( 'day' => '2017-01-04', 'type' => 'Junk', ), )

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:
82.27 ms | 406 KiB | 5 Q