From: gredata at yahoo dot com
Operating system: linux
PHP version: 4.3.10
PHP Bug Type: *General Issues
Bug description: error in exception handling
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
--
Edit bug report at http://bugs.php.net/?id=31696&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31696&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=31696&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=31696&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=31696&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=31696&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=31696&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=31696&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=31696&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=31696&r=support
Expected behavior: http://bugs.php.net/fix.php?id=31696&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=31696&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=31696&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=31696&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31696&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=31696&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=31696&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=31696&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=31696&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=31696&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=31696&r=mysqlcfg