Doc #16920 [NEW]: Bad code sample for rethrowing exceptions in PEAR coding guide
| From: | chadd at fidelissys dot com | Date: | Thu, 17 Dec 2009 17:56:17 +0000 |
| Subject: | Doc #16920 [NEW]: Bad code sample for rethrowing exceptions in PEAR coding guide | ||
| Groups: | php.pear.doc php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-11882@lists.php.net to get a copy of this message | ||
From: #186ac180883d4301c54
Operating system:
Package version:
PHP version: Irrelevant
Package: Documentation
Bug Type: Documentation Problem
Bug description: Bad code sample for rethrowing exceptions in PEAR coding guide
Description:
------------
On the page:
http://pear.php.net/manual/en/standards.errors.php
Section: "Rethrowing an exception"
The example code is missing the dollar sign in "catch (... e)"
and "throw new
...(..., e);", resulting in a parse error.
Also, these custom exceptions apparently support chaining, in
a way
incompatible with PHP 5.3's native support. This should
probably be noted,
or the sample updated.
P.S. Not that it matters, but the PHP version dropdown on the
bug report
form ends at 5.2.5, although the official release is up to 5.2.12
by now.
Expected result:
----------------
No errors (under E_STRICT|E_ALL as specified elsewhere in the
PEAR coding standards).
Actual result:
--------------
PHP Parse error: syntax error, unexpected T_STRING, expecting
T_VARIABLE in ...
--
Edit bug report at http://pear.php.net/bugs/bug.php?id=16920&edit=1
--