note 78578 rejected from language.exceptions by ezyang

From: Date: Thu, 18 Oct 2007 02:07:27 +0000
Subject: note 78578 rejected from language.exceptions by ezyang
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-131480@lists.php.net to get a copy of this message
Note Submitter: jt dot online at web dot de ---- 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?

« previous php.notes (#131480) next »