What are 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, it is best to use the bean class. But in PHP, I always see the returned array, but in Netbeans itβs hard to know what the keys to the array are, only reading documents with the class is simpler, but on the other hand, it gives more work. So ... What is the best way?
source share