3v4l.org

run code in 300+ PHP versions simultaneously
<?php $process = '27-Jun-2017 15:13:46'; $disclosure = '26/10/1992'; function process_date ($date) { 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
Warning: Undefined variable $formattedDate in /in/G5NlD on line 8 string(13) "27th Jun 2017" Warning: Undefined variable $formattedDate in /in/G5NlD on line 8 Fatal error: Uncaught Error: Call to a member function format() on bool in /in/G5NlD:12 Stack trace: #0 /in/G5NlD(16): process_date('26/10/1992') #1 {main} thrown in /in/G5NlD on line 12
Process exited with code 255.
Output for rfc.property-hooks
Warning: Undefined variable $formattedDate in /in/G5NlD on line 8 string(13) "27th Jun 2017" Warning: Undefined variable $formattedDate in /in/G5NlD on line 8 Fatal error: Uncaught Error: Call to a member function format() on false in /in/G5NlD:12 Stack trace: #0 /in/G5NlD(16): process_date('26/10/1992') #1 {main} thrown in /in/G5NlD on line 12
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:
67.18 ms | 401 KiB | 8 Q