3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $var = array('in_monitoring' => new DateTime('now', new DateTimeZone('UTC'))); $json = json_encode($var); echo $json; $arr = json_decode($json); print_r($arr); echo PHP_EOL, $arr['in_monitoring']->format('Y-m-d H:i:s');
based on 7ppBf
Output for 7.2.0
{"in_monitoring":{"date":"2015-11-16 17:21:46.003136","timezone_type":3,"timezone":"UTC"}}stdClass Object ( [in_monitoring] => stdClass Object ( [date] => 2015-11-16 17:21:46.003136 [timezone_type] => 3 [timezone] => UTC ) ) Fatal error: Uncaught Error: Cannot use object of type stdClass as array in /in/lItfc:12 Stack trace: #0 {main} thrown in /in/lItfc on line 12
Process exited with code 255.
Output for 7.1.10
{"in_monitoring":{"date":"2015-11-16 17:21:46.004853","timezone_type":3,"timezone":"UTC"}}stdClass Object ( [in_monitoring] => stdClass Object ( [date] => 2015-11-16 17:21:46.004853 [timezone_type] => 3 [timezone] => UTC ) ) Fatal error: Uncaught Error: Cannot use object of type stdClass as array in /in/lItfc:12 Stack trace: #0 {main} thrown in /in/lItfc on line 12
Process exited with code 255.
Output for 7.1.7
{"in_monitoring":{"date":"2015-11-16 17:21:46.005015","timezone_type":3,"timezone":"UTC"}}stdClass Object ( [in_monitoring] => stdClass Object ( [date] => 2015-11-16 17:21:46.005015 [timezone_type] => 3 [timezone] => UTC ) ) Fatal error: Uncaught Error: Cannot use object of type stdClass as array in /in/lItfc:12 Stack trace: #0 {main} thrown in /in/lItfc on line 12
Process exited with code 255.
Output for 7.1.6
{"in_monitoring":{"date":"2015-11-16 17:21:46.011058","timezone_type":3,"timezone":"UTC"}}stdClass Object ( [in_monitoring] => stdClass Object ( [date] => 2015-11-16 17:21:46.011058 [timezone_type] => 3 [timezone] => UTC ) ) Fatal error: Uncaught Error: Cannot use object of type stdClass as array in /in/lItfc:12 Stack trace: #0 {main} thrown in /in/lItfc on line 12
Process exited with code 255.
Output for 7.1.5
{"in_monitoring":{"date":"2015-11-16 17:21:46.010708","timezone_type":3,"timezone":"UTC"}}stdClass Object ( [in_monitoring] => stdClass Object ( [date] => 2015-11-16 17:21:46.010708 [timezone_type] => 3 [timezone] => UTC ) ) Fatal error: Uncaught Error: Cannot use object of type stdClass as array in /in/lItfc:12 Stack trace: #0 {main} thrown in /in/lItfc on line 12
Process exited with code 255.
Output for 7.1.0
{"in_monitoring":{"date":"2015-11-16 17:21:46.004151","timezone_type":3,"timezone":"UTC"}}stdClass Object ( [in_monitoring] => stdClass Object ( [date] => 2015-11-16 17:21:46.004151 [timezone_type] => 3 [timezone] => UTC ) ) Fatal error: Uncaught Error: Cannot use object of type stdClass as array in /in/lItfc:12 Stack trace: #0 {main} thrown in /in/lItfc on line 12
Process exited with code 255.
Output for 7.0.20
{"in_monitoring":{"date":"2015-11-16 17:21:46.000000","timezone_type":3,"timezone":"UTC"}}stdClass Object ( [in_monitoring] => stdClass Object ( [date] => 2015-11-16 17:21:46.000000 [timezone_type] => 3 [timezone] => UTC ) ) Fatal error: Uncaught Error: Cannot use object of type stdClass as array in /in/lItfc:12 Stack trace: #0 {main} thrown in /in/lItfc on line 12
Process exited with code 255.
Output for 7.0.0 - 7.0.9
{"in_monitoring":{"date":"2015-11-16 17:21:45.000000","timezone_type":3,"timezone":"UTC"}}stdClass Object ( [in_monitoring] => stdClass Object ( [date] => 2015-11-16 17:21:45.000000 [timezone_type] => 3 [timezone] => UTC ) ) Fatal error: Uncaught Error: Cannot use object of type stdClass as array in /in/lItfc:12 Stack trace: #0 {main} thrown in /in/lItfc on line 12
Process exited with code 255.
Output for 5.6.28
{"in_monitoring":{"date":"2015-11-16 17:21:46.000000","timezone_type":3,"timezone":"UTC"}}stdClass Object ( [in_monitoring] => stdClass Object ( [date] => 2015-11-16 17:21:46.000000 [timezone_type] => 3 [timezone] => UTC ) ) Fatal error: Cannot use object of type stdClass as array in /in/lItfc on line 12
Process exited with code 255.
Output for 5.5.14 - 5.6.24
{"in_monitoring":{"date":"2015-11-16 17:21:45.000000","timezone_type":3,"timezone":"UTC"}}stdClass Object ( [in_monitoring] => stdClass Object ( [date] => 2015-11-16 17:21:45.000000 [timezone_type] => 3 [timezone] => UTC ) ) Fatal error: Cannot use object of type stdClass as array in /in/lItfc on line 12
Process exited with code 255.
Output for 5.5.0 - 5.5.13
{"in_monitoring":{"date":"2015-11-16 17:21:45","timezone_type":3,"timezone":"UTC"}}stdClass Object ( [in_monitoring] => stdClass Object ( [date] => 2015-11-16 17:21:45 [timezone_type] => 3 [timezone] => UTC ) ) Fatal error: Cannot use object of type stdClass as array in /in/lItfc on line 12
Process exited with code 255.