Posted by Pugi! on 08/09/06 15:36
Hi,
How can you catch a fatal error that occurs when you use a
require_once("myfile.php") and the file dioesn't exist ?
I tried:
try {
require_once("p.php");
} catch (Exception $e) {
echo $e->getMessage();
}
but it returns
Warning: require_once(p.php) [function.require-once]: failed to open stream:
No such file or directory in D:\apache\xampp\htdocs\site\untitled.php on
line 12
Fatal error: require_once() [function.require]: Failed opening required
'p.php' (include_path='.;D:\apache\xampp\php\pear\') in
D:\apache\xampp\htdocs\site\untitled.php on line 12
So the try/catch is in fact completely ignored.
Pugi!
Navigation:
[Reply to this message]
|