3v4l.org

run code in 300+ PHP versions simultaneously
<?php function converteData($format, $to_format, $time, $timezone = null) { if (!$timezone) { $timezone = new DateTimeZone(date_default_timezone_get()); } $d = date_create_from_format($format, $date, $timezone); return date_format($d, $to_format); } var_dump(converteData('d/m/Y', 'd/m/Y H:i', '06/11/1992'));
Output for git.master, git.master_jit
Warning: Undefined variable $date in /in/O2q2g on line 8 Deprecated: date_create_from_format(): Passing null to parameter #2 ($datetime) of type string is deprecated in /in/O2q2g on line 8 Fatal error: Uncaught TypeError: date_format(): Argument #1 ($object) must be of type DateTimeInterface, bool given in /in/O2q2g:9 Stack trace: #0 /in/O2q2g(9): date_format(false, 'd/m/Y H:i') #1 /in/O2q2g(12): converteData('d/m/Y', 'd/m/Y H:i', '06/11/1992') #2 {main} thrown in /in/O2q2g on line 9
Process exited with code 255.
Output for rfc.property-hooks
Warning: Undefined variable $date in /in/O2q2g on line 8 Deprecated: date_create_from_format(): Passing null to parameter #2 ($datetime) of type string is deprecated in /in/O2q2g on line 8 Fatal error: Uncaught TypeError: date_format(): Argument #1 ($object) must be of type DateTimeInterface, false given in /in/O2q2g:9 Stack trace: #0 /in/O2q2g(9): date_format(false, 'd/m/Y H:i') #1 /in/O2q2g(12): converteData('d/m/Y', 'd/m/Y H:i', '06/11/1992') #2 {main} thrown in /in/O2q2g on line 9
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.29 ms | 401 KiB | 8 Q