This may be a funny question. But how does php get rendered, I know it is a top down interpreter. But does that change when using classes. If I make a bunch of variables in a function do all the variables get interpreted first and then the function logic or does the function logic get interpreted first and then interpret the variables in the function relies on?

Recommended Answers

All 2 Replies

The way that I understand it is that variables are defined first, then functions are defined (including custom user defined functions), then from that data any E_Notice errors are generated. After that, I am guessing that it goes through a conversion process (into binary) which is when the fatal errors are produced then is interperated from top to bottom except the custom functions which were defined earlier.
I am not saying that is exactly how it is goes but from my experience that is how I believe it goes.

New control structure in the works for php 5.3 might have what I am looking for.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.