On 9/25/07, Kexiao Liao <[EMAIL PROTECTED]> wrote: > > There are a lot of classes in ZF have toArray() method, for example the > Zend_Config_Ini has this method. Does this method belong to ZF or it belongs > to php5. What is the purpose of this method? > -- > View this message in context: > http://www.nabble.com/toArray%28%29-Method-tf4517369s16154.html#a12885790 > Sent from the Zend Framework mailing list archive at Nabble.com. >
The purpose of this method is no different than __toString() in the idea since, except it returns an array instead of a string. Only difference is toArray() is self-created, not a magic method, and must be called directly. It doesn't "belong" to anybody. The naming is used for pure sanity sakes; toArray() for converting your class to an array. -- Philip [EMAIL PROTECTED] http://www.gpcentre.net/
