function myfunc ()
{
$a['foo'] = 'bar';
$a['baz'] = 'qux';
return $a;
}
How do you do it so that when you call $a = myfunc(); you can use echo $a->foo; and it will output bar?
Additional question: Having that simple function above, is it better to return an array or object?
issetvs.emptyvs.is_arrayis entirely pointless, for instance, since they all do very different things and are used in different situations. Don't choose which to use based on minuscule performance differences.