note 78578 added to language.exceptions
| From: | jt dot online at web dot de | Date: | Thu, 18 Oct 2007 01:01:30 +0000 |
| Subject: | note 78578 added to language.exceptions | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-131479@lists.php.net to get a copy of this message | ||
So I have problems figuring this out:
This script works perfectly on my computer with PHP 5:
<?php
try
{
if( file_exists('filename.php') )
{
include 'filename.php';
}
else
{
throw new Exception('File not found');
}
}
catch (Exception $e)
{
echo $e->getMessage();
echo ' in '.$e->getFile().', line: '. $e->getLine().'.';
}
?>
When a friend tries the same (PHP 5.2.1) it causes the following error:
[18-Oct-2007 01:28:46] PHP Fatal error: Uncaught exception 'Exception' with message
'File not found' in /Applications/MAMP/htdocs/test.php:9
Stack trace:
#0 {main}
thrown in /Applications/MAMP/htdocs/test.php on line 9
Any ideas on what the problem could be?
----
Server IP: 203.202.10.60
Probable Submitter: 132.234.251.211 (proxied: 132.234.202.202)
----
Manual Page -- http://www.php.net/manual/en/language.exceptions.php
Edit -- https://master.php.net/note/edit/78578
Del: integrated -- https://master.php.net/note/delete/78578/integrated
Del: useless -- https://master.php.net/note/delete/78578/useless
Del: bad code -- https://master.php.net/note/delete/78578/bad+code
Del: spam -- https://master.php.net/note/delete/78578/spam
Del: non-english -- https://master.php.net/note/delete/78578/non-english
Del: in docs -- https://master.php.net/note/delete/78578/in+docs
Del: other reasons-- https://master.php.net/note/delete/78578
Reject -- https://master.php.net/note/reject/78578
Search -- https://master.php.net/manage/user-notes.php