new class_name?
I need to return an array in this way not whole class properties
class yourClass { public function toArray() { return [...]; } }
The closest one is probably jsonserializable or try this https://stackoverflow.com/questions/11841637/php-arrayable-interface
Make an explicit named method and call it Stop relying or even using magic methods, it's bad, it hides details without proper interfaces, even confuses IDEs, let alone other fellow developers who will work on it in future
Обсуждают сегодня