TECTED]
> > Sent: Wednesday, November 26, 2003 8:55 PM
> > To: Daevid Vincent
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: [PHP] BUG: require_once() or die(); = fatal error
> >
> > This code doesn't make much sense. By definition, if require
> > cannot
* Thus wrote Daevid Vincent ([EMAIL PROTECTED]):
> My way, the logic is that the file *is* 'required' (whereas I view 'include'
> files as optional), and I want to exit the program with a graceful message
> instead of the fatal error (which doesn't really doesn't tell me what the
> problem is -- "F
, 2003 8:55 PM
> To: Daevid Vincent
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] BUG: require_once() or die(); = fatal error
>
> This code doesn't make much sense. By definition, if require
> cannot open
> a file it throws a fatal error, so you would never hit the "o
This code doesn't make much sense. By definition, if require cannot open
a file it throws a fatal error, so you would never hit the "or" case
anyway. Hence there is no return code from require and you can't write
code like this. If you want to test the return code you need to use
'include' inste
Using PHP 4.2.2 on Linux RH8:
In a PHP script run from command line,
require_once("gibberator_data.php") or die("No Data file found\n");
Causes:
[EMAIL PROTECTED] gibberator]# ./gibberator.php
Fatal error: Failed opening required '1'
(include_path='.:/php/includes;/usr/share/phpwebto
5 matches
Mail list logo