logo       

Re: RE: [SMARTY] php5 Iterators.: msg#00011

Subject: Re: RE: [SMARTY] php5 Iterators.
boots wrote:

FWIW, is_a is not available prior to PHP 4.2 so we would actually need
to implement it. The Pear compat library has what appears to be an
adequate BC implementation:
http://cvs.php.net/co.php/pear/PHP_Compat/Compat/Function/is_a.php?r=1.15

In fact we can just use function_exists.

I can see why people want to overload foreach for object support under
PHP5

but I wonder if it might be a better idea to introduce a new tag
(say, forevery or onevery or something) even if just to keep the amount
of BC headaches and pitfalls to a minimum.

-1.

xo boots

--- Boris Bezrukov <lovchy@xxxxxxx> wrote:

George Miroshnikov wrote:

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?

Yes, it is. And it should be used.

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.




--
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe