| George Miroshnikov 2005-01-17, 8:59 pm |
| Hello David,
What about using instanceof operator?
It would raise parser error on php4, but my thought is all php5 code
could be (temporarily?) moved into separate plugin that will be
conditionally included if Smarty is being run on php5 box.
Or maybe use runtime functions to avoid parser error.
I'm wondering, if is_a() is forward-compatible with interfaces?
Monday, January 17, 2005, 10:45:01 PM, you wrote:
DZ> Jochem,
DZ> Someone posted a patch for this "problem" a couple of days ago on the
DZ> Developers list (this is where this discussion belongs to anyway, so I'm
DZ> crossposting there).
DZ> I totally agree with you, we need the possibility to use iterators. The
DZ> point is we need to find a clean way to implement this without breaking BC.
DZ> If we just do an is_object() check, we will break BC because you actually
DZ> CAN loop over objects using foreach, it will return the property values (and
DZ> their names as keys). We cannot remove the array casting either because some
DZ> people might rely on the fact that their int, string, whatever gets
DZ> converted to a one-value array and they can loop over them.
|