|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-01-25 23:36 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 23:00:01 2025 UTC |
Description: ------------ Hello I've installed apache2 and php-4.3.10 I copy from on-line documentation one part about exceptions just like is it and it is not working. Look below. Why you putted something in docs that is not working???? Reproduce code: --------------- <?php try { $error = 'Always throw this error'; throw new Exception($error); // Code following an exception is not executed. echo 'Never executed'; } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; } // Continue execution echo 'Hello World'; ?> Expected result: ---------------- Caught exception: Always throw this error Hello World Actual result: -------------- Parse error: parse error, unexpected '{' in /var/www/localhost/htdocs/testing/tt.php on line 2