For example, if let's say I have a database of users. I have a class that gets information form the database about these users.
I want to make the class "self aware" of it's own name, like this:
<?php
class UserData {
//[code that fetches the ID number from the variable name, and queries the database for info]
}
$user24 = new UserData;
echo 'Welcome, '.$user24->name.'!';
?>
This code would, ideally, output something like "Welcome, Bob!", and would change depending on what I named it. Is this possible?