[Pmwiki-users] include_once vs. require_once

Thomas -Balu- Walter list+pmwiki-users
Mon Nov 22 02:34:24 CST 2004


On Sun, Nov 21, 2004 at 11:32:16PM +0100, Knut Alboldt wrote:
> At 01:21 21.11.2004, you wrote:
> >On Sun, Nov 21, 2004 at 12:01:40AM +0100, Knut Alboldt wrote:
> >> just a simple question to the php-guru's:
> >>
> >> why to use / recommend include / include_once instead of require /
> >> require_once when to include cookbook-pages / config-pages ?
> >
> >Require is just as good as include;
> 
> oh, I thought if a required php-script isn't found it will produce an error 
> while an included php-scipt not found will produce simple a warning ?

correct.

"The two constructs are identical in every way except how they handle
failure. include() produces a Warning while require()  results in a
Fatal Error. In other words, use require() if you want a missing file to
halt processing of the page. include() does not behave this way, the
script will continue regardless."

     Balu



More information about the pmwiki-users mailing list