3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo json_encode(new DateTime('@1419237113')); echo json_decode('{"date":"2014-12-22 08:31:53.000000","timezone_type":1,"timezone":"+00:00"}');
Output for 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
{"date":"2014-12-22 08:31:53.000000","timezone_type":1,"timezone":"+00:00"} Fatal error: Uncaught Error: Object of class stdClass could not be converted to string in /in/kTLcd:4 Stack trace: #0 {main} thrown in /in/kTLcd on line 4
Process exited with code 255.
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33
{"date":"2014-12-22 08:31:53.000000","timezone_type":1,"timezone":"+00:00"} Recoverable fatal error: Object of class stdClass could not be converted to string in /in/kTLcd on line 4
Process exited with code 255.
Output for 5.5.14 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20
{"date":"2014-12-22 08:31:53.000000","timezone_type":1,"timezone":"+00:00"} Catchable fatal error: Object of class stdClass could not be converted to string in /in/kTLcd on line 4
Process exited with code 255.
Output for 5.5.0 - 5.5.13
{"date":"2014-12-22 08:31:53","timezone_type":1,"timezone":"+00:00"} Catchable fatal error: Object of class stdClass could not be converted to string in /in/kTLcd on line 4
Process exited with code 255.

preferences:
190.93 ms | 401 KiB | 271 Q