-- dinok <[EMAIL PROTECTED]> wrote
(on Saturday, 26 January 2008, 02:31 AM -0800):
> 
> It doesn't work with 5.2.1, too :)
> Since I migrated to 5.2.5 it works fine.
> But I have to agree with Simon, because in the Zend_Form.php it's also an
> array which stores the attributes! So why to build two different solutions
> for the same problem?

Because they're not the same type of object, and they do separate
things.

Overloading is used in Zend_Form and Zend_Form_Element to access
metadata; it's the *type* of metadata that differs. In
Zend_Form_Element, *everything* is metadata, basically, so overloading
is used for all attributes. In Zend_Form, the primary metadata are the
items that make up a form -- elements, groups, and sub forms. All other
metadata is secondary. Thus, overloading is used to access the form
items themselves.

Storage differs between the two because of how overloading works, or,
rather, doesn't. A regression was introduced in PHP in 5.2.0; items
returned by __get() were no longer returned by reference (unless they
were objects); as a result, accessing array members via __get() broke.
To get around this, you can simply set public members, which fixes the
issue.  The problem is that, to get a list of properties, you have to do
reflection on the object -- and, as Simon noted, the mechanism for doing
so differs between 5.1.x and 5.2.x due to incompatabilities in the
internals.

I'll have a fix in place in the coming week.

-- 
Matthew Weier O'Phinney
PHP Developer            | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to