3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $comp = '[{"date":"2014-10-04","day:"mon"},{"date":"2014-10-03","day":"tue"}]'; $arr1 = array('date' => '2015-10-04' , 'day' => 'wed'); array_push(json_decode($comp,true),$arr1); echo json_encode($comp);
Output for 7.0.0 - 7.2.0
Notice: Only variables should be passed by reference in /in/4YZkH on line 5 Warning: array_push() expects parameter 1 to be array, null given in /in/4YZkH on line 5 "[{\"date\":\"2014-10-04\",\"day:\"mon\"},{\"date\":\"2014-10-03\",\"day\":\"tue\"}]"
Output for 5.5.0 - 5.6.28
Strict Standards: Only variables should be passed by reference in /in/4YZkH on line 5 Warning: array_push() expects parameter 1 to be array, null given in /in/4YZkH on line 5 "[{\"date\":\"2014-10-04\",\"day:\"mon\"},{\"date\":\"2014-10-03\",\"day\":\"tue\"}]"