3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $data = (object) [[ 'id' => 3, 'rota_name' => 'Tea and coffee', 'rota_owner_name' => 9, 'rota_notes' => '', 'rota_entry' => '{"rota_entry0":{"person":"8","rota_assignment_date":"2018-04-01 20:17:48","rota_role":""},"rota_entry1":{"person":"7","rota_assignment_date":"2018-04-08 20:17:48","rota_role":""},"rota_entry2":{"person":"11","rota_assignment_date":"2018-04-15 20:17:48","rota_role":""},"rota_entry3":{"person":"7","rota_assignment_date":"2018-04-22 20:17:48","rota_role":""},"rota_entry4":{"person":"10","rota_assignment_date":"2018-04-29 20:17:48","rota_role":""},"rota_entry5":{"person":"3","rota_assignment_date":"2018-05-06 20:18:20","rota_role":""},"rota_entry6":{"person":"11","rota_assignment_date":"2018-05-13 20:18:23","rota_role":""}}', 'rota_advance_email_days' => '', 'rota_reminder_sent' => NULL, ]]; $data = array_map(function ($value) { return (object) str_replace('"person":"8"', '"person":"9"', (array) $value); }, (array) $data); print_r($data);
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.1.0 - 7.3.0alpha1
Array ( [0] => stdClass Object ( [id] => 3 [rota_name] => Tea and coffee [rota_owner_name] => 9 [rota_notes] => [rota_entry] => {"rota_entry0":{"person":"9","rota_assignment_date":"2018-04-01 20:17:48","rota_role":""},"rota_entry1":{"person":"7","rota_assignment_date":"2018-04-08 20:17:48","rota_role":""},"rota_entry2":{"person":"11","rota_assignment_date":"2018-04-15 20:17:48","rota_role":""},"rota_entry3":{"person":"7","rota_assignment_date":"2018-04-22 20:17:48","rota_role":""},"rota_entry4":{"person":"10","rota_assignment_date":"2018-04-29 20:17:48","rota_role":""},"rota_entry5":{"person":"3","rota_assignment_date":"2018-05-06 20:18:20","rota_role":""},"rota_entry6":{"person":"11","rota_assignment_date":"2018-05-13 20:18:23","rota_role":""}} [rota_advance_email_days] => [rota_reminder_sent] => ) )