3v4l.org

run code in 300+ PHP versions simultaneously
<?php $r = specialSetStartEndDate(['H (Zeitraum)' => '2015-07 2015-09']); echo($r); function specialSetStartEndDate($values, $params) { assert(array_key_exists('H (Zeitraum)', $values)); $period = $values['H (Zeitraum)']; $dates = explode(' ', $period); $start_date = DateTime::createFromFormat('Y-d', $dates[0]); $end_date = DateTime::createFromFormat('Y-d', $dates[1]); if (false == $start_date || false == $end_date) { throw new EWDRMI_Exception("Invalid input format of date '$period'", EWDRMI_Exception::BREAK_ROW); } $start_date->modify('first day of'); $end_date->modify('last day of'); $result = array( 'start_date' => $start_date->format('Y-m-d'), 'end_date' => $end_date->format('Y-m-d'), ); return $result; }
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught ArgumentCountError: Too few arguments to function specialSetStartEndDate(), 1 passed in /in/C7g72 on line 4 and exactly 2 expected in /in/C7g72:7 Stack trace: #0 /in/C7g72(4): specialSetStartEndDate(Array) #1 {main} thrown in /in/C7g72 on line 7
Process exited with code 255.

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:
45.12 ms | 401 KiB | 8 Q