Array in Object passed by value?

thiva7

New Member
Maybe I am overlooking something, but I stumbled across this:\[code\]$employees = new stdClass();$employee_id = 5;$employee = array();$employee["id"] = $employee_id;$employee["name"] = "John;$employees->$employee_id = $employee;\[/code\]Now I want to change the employee Name:\[code\]$employee = $employees->$employee_id;$employee["name"] = "Tom";\[/code\]Now I have two problems:[*]The employee object seems not to be passed by reference, because the employee within the employees is still named John.[*]How would I retrieve the employee name?echo {$employee->$employee_id}["name"];does not workThanks for the help,Martin
 
Back
Top