I'm experimenting with OOP and PHP.
I don't know why I would ever need to do something like this but I'm wondering how it would be done and cant find it online.
class Example{
public $a = 'aye';
public $b = 'bee';
public $c = 'see';
public function how(){
return (object)array(
$this->a,
$this->b,
$this->c
);
}
}
$example = new Example;
$how = $example->how();
echo $how->1; //I thought would print bee
I'm aware that giving the array keys would let me do
echo $how->beekey //which would give me beekey's value