3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $data = array( 'report_id' => (int)1, 'openDate' => '2015-09-08 12:06:00', 'openedBy' => 42, 'response' => array( 'text' => 'sdfsdfsdfsdf', 'creationDate' => '2015-09-08 12:06:00', 'author' => 42 ), 'credits' => array( 'member_id' => 24, 'campaign_id' => 2, 'category' => 5, 'description' => 'sdfsdfsdf', 'date' => '2015-09-08 12:06:00', 'amount' => 2 ) ); //if(!empty($r['publish'])) { array_merge ($data, array('published'=> 1)); //} die(var_dump($data));
based on 9amcW
Output for 5.3.17 - 7.2.0
array(5) { ["report_id"]=> int(1) ["openDate"]=> string(19) "2015-09-08 12:06:00" ["openedBy"]=> int(42) ["response"]=> array(3) { ["text"]=> string(12) "sdfsdfsdfsdf" ["creationDate"]=> string(19) "2015-09-08 12:06:00" ["author"]=> int(42) } ["credits"]=> array(6) { ["member_id"]=> int(24) ["campaign_id"]=> int(2) ["category"]=> int(5) ["description"]=> string(9) "sdfsdfsdf" ["date"]=> string(19) "2015-09-08 12:06:00" ["amount"]=> int(2) } }