Lets say I have this code:
<?php
class hello {
var $greeting = "hello";
function hello(){
echo $this->greeting;
return;
}
}
$hello1 = new hello;
$hello2 = new hello;
$hello4 = new hello;
?>
How do I get it to echo all the names of instantiated objects (and if possible their respective class), so that it echos (possibly in an array) "hello1 => hello, hello2 => hello, hello4 => hello".
If this is not possible, is there any way to tell the name of the instance from within the class, something like echo instance_name($this); would get me "hello1". Thanks.