FWIW I do prefer having a specific interface to do such conversions. I was just trying to find a way to have list-like or Traversable objects ability to be converted to plain array. This brings more problems than actually solving. I will just stop thinking about this and can give this thread as reference of why this feature would be a bad idea.
- Re: [PHP-DEV] Add __toArray() met... Fleshgrinder
- Re: [PHP-DEV] Add __toArray() met... Benoît Burnichon
- Re: [PHP-DEV] Add __toArray() met... Ryan Pallas
- Re: [PHP-DEV] Add __toArray()... Marco Pivetta
- Re: [PHP-DEV] Add __toArray()... Ryan Pallas
- Re: [PHP-DEV] Add __toArray()... Marco Pivetta
- Re: [PHP-DEV] Add __toArray()... Andrey Andreev
- Re: [PHP-DEV] Add __toArray()... Marco Pivetta
- Re: [PHP-DEV] Add __toArray()... Andrey Andreev
- Re: [PHP-DEV] Add __toArray()... Marco Pivetta
- Re: [PHP-DEV] Add __toArray()... Benoît Burnichon
- Re: [PHP-DEV] Add __toArray()... Marco Pivetta
- Re: [PHP-DEV] Add __toArray()... Marcio Almada
- Re: [PHP-DEV] Add __toArray()... Marco Pivetta
- Re: [PHP-DEV] Add __toArray() method to ob... Sebastian Bergmann
- [PHP-DEV] Re: Add __toArray() method to objects that wo... Andrea Faulds