It works because of the 'short-circuit' feature of PHP if statements. An 'or' condition test stops on the first true.

if (TRUE || any-test) is always true, so it stops testing and any-test is never evaluated.

if (FALSE || any-test) could be true if any-test is true, so any-test must be evaluated.

So if the dynamic_sidebar function does not exist, the if-test stops.

If the first condition is false, the if-test continues because one of the following conditions may be true. In this case the result of the second condition is immaterial because the function dynamic_sidebar() is executed.

Thanks so much for your reply. I was confused by the fact that there was no code to be executed within the if statement.

if (true) {
no code here
}

from your explanation, I see that the function dynamic_sidebar() is executed while the if statement is evaluated, if the function exists. If I understand your response correctly, the following snippet would have the same result:

Sorry to bother you both, as I see this was closed a couple of months ago, but are we saying that if the 'dynamic_sidebar()' is even queried, using the 'if' statement then the WordPress will call the dynamic sidebar into existence, in the exact place that the function was queried?

for example:

lets say that "if(!dynamic_sidebar()):..." was proved to be false, meaning that the dynamic sidebar was actually active, then WordPress would automatically spit out the dynamic sidebar into the place where this conditional if statement was placed?