3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $data = new DateTime('now', new DateTimeZone('UTC')); $date = $data->format('Y-m-d H:i:s'); $name = 'Acompanhamento'; $k = null; $log = json_decode($k,true); $log[] = array('in_'.$name => $date); $k = json_encode($log); var_dump($log); var_dump($k); echo json_decode($k,true);
based on HSlRE
Output for 5.6.28, 7.0.20 - 7.2.0
array(1) { [0]=> array(1) { ["in_Acompanhamento"]=> string(19) "2015-11-16 19:26:25" } } string(45) "[{"in_Acompanhamento":"2015-11-16 19:26:25"}]" Notice: Array to string conversion in /in/WDVhI on line 15 Array
Output for 5.5.0 - 5.6.24, 7.0.0 - 7.0.9
array(1) { [0]=> array(1) { ["in_Acompanhamento"]=> string(19) "2015-11-16 19:26:24" } } string(45) "[{"in_Acompanhamento":"2015-11-16 19:26:24"}]" Notice: Array to string conversion in /in/WDVhI on line 15 Array