Doc #68293 [Opn->Csd]: bad example

From: Date: Sat, 22 Nov 2014 19:05:44 +0000
Subject: Doc #68293 [Opn->Csd]: bad example
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-11694@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68293&edit=1 ID: 68293 Updated by: salathe@php.net Reported by: rasmus at mindplay dot dk Summary: bad example -Status: Open +Status: Closed Type: Documentation Problem Package: Documentation problem PHP Version: 5.4.34 -Assigned To: +Assigned To: salathe Block user comment: N Private report: N New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Previous Comments: ------------------------------------------------------------------------ [2014-11-19 16:49:46] salathe@php.net Automatic comment from SVN on behalf of salathe Revision: http://svn.php.net/viewvc/?view=revision&revision=335199 Log: respect error_reporting level in ErrorException example (doc bug #68293) ------------------------------------------------------------------------ [2014-10-23 20:28:37] rasmus at mindplay dot dk Description: ------------ --- From manual page: http://www.php.net/class.errorexception --- The example quoted in the documentation will break the @ error suppression operator - it won't work, and also doesn't respect the error_reporting() setting, which needs to be checked either way to make sure the @ operator works as expected. See below for a working example. Test script: --------------- function exception_error_handler($errno, $errstr, $errfile, $errline) { $error = new ErrorException($errstr, 0, $errno, $errfile, $errline); if ($error->getSeverity() & error_reporting()) { throw $error; } } Expected result: ---------------- See above. Actual result: -------------- See above ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68293&edit=1

« previous php.doc.bugs (#11694) next »