Say I have an array like the following:
$arr = array(
'id' => 123,
'title' => 'Example Title',
);
How come I cannot access the values using PHP's object operator (->
)? In theory, I should be able to do $arr->title
but that doesn't work and I have to access it as $arr['title']
instead.
I've been reading plenty of examples of people using the object operator however it's not returning anything but a null value.
Has something changed in recent versions of PHP or am I misunderstanding the examples given?