Skip to content

Instantly share code, notes, and snippets.

@dunglas
Created April 21, 2016 08:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dunglas/8f4fb31ace313c95285a9344263f2d99 to your computer and use it in GitHub Desktop.
Save dunglas/8f4fb31ace313c95285a9344263f2d99 to your computer and use it in GitHub Desktop.
Access a PHP special key /cc @vincentchalamon
$c = (object) ['@context' => 'foo'];
var_dump($c);
/*
php shell code:1:
class stdClass#1 (1) {
public $@context =>
string(3) "foo"
}
*/
$key = '@context';
var_dump($c->{$key});
/*
php shell code:1:
string(3) "foo"
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment