Which and why are the best practices for this case, in PHP:
class Main {
public function getSomeBean() {
...
return array(
'value1' => $value1,
'value2' => $value2
);
}
}
or
class SomeBean() {
$value1;
$value2;
}
class Main {
public function getSomeBean() {
$someBean = new SomeBean();
...
return $someBean;
}
}
In java is a best practice use always a bean class. But in PHP i always see return array, but in Netbeans is hard to know what is the keys of array, only reading the docs, with a class is more easy, but on the other hand, gives more work. So... what is the best way?