What will the following code (in isolation) output?
If you said
no then you are sadly mistaken. PHP treats any undefined global constant as a string so the above code would read like this:
When it is written like that, it is a lot easier to see why
yes is printed. Any string other than '' (empty string) evaluates to
This is one argument against using
defines. Most would suggest using class constants instead.