Question from newbie

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Question from newbie

Post by VladSun »

include() won't stop the code execution if the file parameter does not exist, while require() will stop it with an error
There are 10 types of people in this world, those who understand binary and those who don't
thinsoldier
Forum Contributor
Posts: 367
Joined: Fri Jul 20, 2007 11:29 am
Contact:

Re: Question from newbie

Post by thinsoldier »

You could easily test this yourself.

The answer is yes. Everything before the "require()" will run and when the require line tries to run and cannot find the file it will stop the code at that line with both a warning and a fatal error.
Warning: I have no idea what I'm talking about.
Post Reply