3v4l.org

run code in 300+ PHP versions simultaneously
<?php function lastWeekDay ($mnt) { $result = strtotime("last day of $mnt"); $day = date('D', $result); if ('Sun' === $day) { $result -= 86400 * 2; } if ('Sat' === $day) { $result -= 86400; } return $result; } $date = '2009-Jan-22'; $sepparator = '-'; $parts = explode($sepparator, $date); $dayForDate = date("l", mktime(0, 0, 0, $parts[1], $parts[2], $parts[0])); echo $dayForDate;
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: mktime(): Argument #4 ($month) must be of type ?int, string given in /in/q7Y17:22 Stack trace: #0 /in/q7Y17(22): mktime(0, 0, 0, 'Jan', '22', '2009') #1 {main} thrown in /in/q7Y17 on line 22
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:
37.55 ms | 401 KiB | 8 Q