How to access object in php when the identifier starts with a @ symbol?

Viewed 353

I have a json object that looks like this:

{#119130 ▼
  +"@id": "1EBEF5DA"
  +"@name": "The"
  +"@renewal": "xxxxx"
  +"@languages": "Eng"
}

How do I access a the JSON data in php when the identifier starts with an @ symbol?

For example trying to access it using $var->@id results in an error:

Parse error: syntax error, unexpected '@', expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$'

I tried $var->id but it results in an Undefined Property.

3 Answers
Related