NYCPHP Meetup

NYPHP.org

[nycphp-talk] constants vs globals

David Mintz dmintz at davidmintz.org
Fri Feb 20 17:13:27 EST 2004


On Fri, 20 Feb 2004, Hans Zaunere wrote:

> > Heh! Which raises the question, then, how many times to you
> > need to read a
> > constant to break even on that up-front expense, as it were,
> > as compared
> > to a variable?
>
> Heh, now that you mention that, I did say ask.  He didn't know - but we
> did talk a bit about it and I think I lead the witness to around 4 or 5
>

But *parsing* the code that contains constants doesn't cost different from
parsing code containing variables, or does it? If not, and if the accesses
are wrapped in "if" blocks, whose execution depends on chance,then you'd
have to devise some sophisticated benchmarking to simulate the real world
and discover the answer..... ergo, I think it's time to go get a beer and
forget this.

Cheers!

---
David Mintz
http://davidmintz.org/

        "Anybody else got a problem with Webistics?" -- Sopranos 24:17



More information about the talk mailing list