Consequences of using operators in an if PHP statement

This may be an obvious question, but I have not found an answer anywhere.

So, if I check if the function works, I put it in the if () condition, for example:

if(!fopen($filename, "w")) print "file not found";

But does he open the file? And does it erase it? (This "w" mode might trigger this.)

Thanks!

+4
source share
1 answer

Yes, the function in the statement ifwill be executed as is.

+1
source

All Articles