What does the brakets mean and where to read more
return $container->{$resource};
The brackets are to make use of variable variables. It makes it easier to distinguish between:
// gets the value of the "resource" member from the container object
$container->resource;
and
// gets the value of the "foo" member from the container object
$resource = 'foo';
$container->$resource;
You can read more here: http://php.net/manual/en/language.variables.variable.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With