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); print_r(json_decode($k,true));
based on YnLfO
Output for 5.6.28, 7.0.20 - 7.2.0
array(1) { [0]=> array(1) { ["in_Acompanhamento"]=> string(19) "2015-11-16 19:35:23" } } string(45) "[{"in_Acompanhamento":"2015-11-16 19:35:23"}]" Array ( [0] => Array ( [in_Acompanhamento] => 2015-11-16 19:35:23 ) )
Output for 5.5.0 - 5.6.23, 7.0.0 - 7.0.8
array(1) { [0]=> array(1) { ["in_Acompanhamento"]=> string(19) "2015-11-16 19:35:22" } } string(45) "[{"in_Acompanhamento":"2015-11-16 19:35:22"}]" Array ( [0] => Array ( [in_Acompanhamento] => 2015-11-16 19:35:22 ) )