I have a function that returns an object. How to write a string that parses a member of the object returned by that function (the function is in a different namespace)? This is what I'm trying to do but the string used on echo is invalid.
namespace security;
function &get_user() {
$user = (object) array('email' => 'abcd@abcd.com', 'name' => 'John Doe');
return $user;
}
echo "<li><p class=\"navbar-text\">Welcome, {${\security\get_user()}->name}</p></li>";
Welcome, " . get_user()->name . "