3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = file_get_contents( "http://json-time.appspot.com/time.json?tz=Europe/London" ); $obj = json_decode($json); $timenow = $obj->{'datetime'}; $date = DateTime::createFromFormat('D, d M Y H:i:s O', $timeNow); echo $date->format('Y-m-d H:i:s'); ?>
Output for git.master, git.master_jit
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for json-time.appspot.com failed: System error in /in/2PKLM on line 3 Warning: file_get_contents(http://json-time.appspot.com/time.json?tz=Europe/London): Failed to open stream: php_network_getaddresses: getaddrinfo for json-time.appspot.com failed: System error in /in/2PKLM on line 3 Warning: Attempt to read property "datetime" on null in /in/2PKLM on line 5 Warning: Undefined variable $timeNow in /in/2PKLM on line 6 Deprecated: DateTime::createFromFormat(): Passing null to parameter #2 ($datetime) of type string is deprecated in /in/2PKLM on line 6 Fatal error: Uncaught Error: Call to a member function format() on bool in /in/2PKLM:7 Stack trace: #0 {main} thrown in /in/2PKLM on line 7
Process exited with code 255.
Output for rfc.property-hooks
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for json-time.appspot.com failed: System error in /in/2PKLM on line 3 Warning: file_get_contents(http://json-time.appspot.com/time.json?tz=Europe/London): Failed to open stream: php_network_getaddresses: getaddrinfo for json-time.appspot.com failed: System error in /in/2PKLM on line 3 Warning: Attempt to read property "datetime" on null in /in/2PKLM on line 5 Warning: Undefined variable $timeNow in /in/2PKLM on line 6 Deprecated: DateTime::createFromFormat(): Passing null to parameter #2 ($datetime) of type string is deprecated in /in/2PKLM on line 6 Fatal error: Uncaught Error: Call to a member function format() on false in /in/2PKLM:7 Stack trace: #0 {main} thrown in /in/2PKLM 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:
86.53 ms | 402 KiB | 8 Q