#43154 [Opn->Fbk]: __toArray() or __toIterator() Magic Method?

From: Date: Wed, 31 Oct 2007 00:27:21 +0000
Subject: #43154 [Opn->Fbk]: __toArray() or __toIterator() Magic Method?
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-119120@lists.php.net to get a copy of this message
ID: 43154 Updated by: johannes@php.net Reported By: smoseley at transio dot com -Status: Open +Status: Feedback Bug Type: Feature/Change Request Operating System: Linux PHP Version: 5.2.4 New Comment: What's wrong with the Iterator and IteratorAggregate interfaces? Previous Comments: ------------------------------------------------------------------------ [2007-10-31 00:21:24] smoseley at transio dot com Description: ------------ Would love to see a __toArray() MM added that would default to an associative array of an object's properties in scope, but that could be overloaded with whatever. It would be very useful in cases where a specific method is required to iterate through an object's properties. Thanks! :) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43154&edit=1

« previous php.bugs (#119120) next »