[development] GoPHP5.org - Drupal 7 and PHP 5.2

Larry Garfield larry at garfieldtech.com
Fri Jul 6 00:16:08 UTC 2007


On Thursday 05 July 2007, adrian rossouw wrote:
> On 05 Jul 2007, at 10:34 PM, Rob Barreca wrote:
> > Nice! Say hello to SimpleXML. :-)
>
> I have to say, one of my favorite parts of simplexml, is the array /
> object duality.
> Attributes are accessed via => , and children are accessed via [].
> This would have been awesome for fapi, if you could actually use it as a
> language feature. (I think they probably implement it via magic
> callbacks, and that only handles the calling, not the definitions.)

Actually I'm pretty sure they just use the ArrayObject interface, which lets 
you provide an array-like syntax to objects.  It doesn't work on all array 
functions, but it does work for [] and foreach loops.

I've been pondering if there's a way we could shift part of FAPI to use 
ArrayObject or even SimpleXML itself.  I think the array parameters (like 
#options) would cause problems, but it's definitely something worth looking 
into.

-- 
Larry Garfield			AIM: LOLG42
larry at garfieldtech.com		ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson


More information about the development mailing list