3v4l.org

run code in 300+ PHP versions simultaneously
<?php $process = DateTime::createFromFormat('d/m/Y', '27-Jun-2017 15:13:46'); $disclosure = DateTime::createFromFormat('d/m/Y', '26/10/1992'); function process_date ($date) { $formattedDate = DateTime::createFromFormat('d/m/Y', $date); var_dump($formattedDate); if (!$formattedDate) { $formattedDate = DateTime::createFromFormat('d-M-Y H:i:s', $date); } var_dump($formattedDate->format('jS M Y')); } process_date($process); process_date($disclosure);
Output for git.master, git.master_jit
bool(false) Fatal error: Uncaught Error: Call to a member function format() on bool in /in/smkPL:13 Stack trace: #0 /in/smkPL(16): process_date(false) #1 {main} thrown in /in/smkPL on line 13
Process exited with code 255.
Output for rfc.property-hooks
bool(false) Fatal error: Uncaught Error: Call to a member function format() on false in /in/smkPL:13 Stack trace: #0 /in/smkPL(16): process_date(false) #1 {main} thrown in /in/smkPL on line 13
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:
53.09 ms | 401 KiB | 8 Q