From 2e3f486dc2c9b1684e122bd894f40e3acafacc46 Mon Sep 17 00:00:00 2001 From: Alan Storm Date: Mon, 17 Feb 2014 16:01:54 -0800 Subject: [PATCH 1/2] Adding information about scream. --- _posts/08-02-01-Errors.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/_posts/08-02-01-Errors.md b/_posts/08-02-01-Errors.md index ae6c1c3..eb4d073 100644 --- a/_posts/08-02-01-Errors.md +++ b/_posts/08-02-01-Errors.md @@ -89,9 +89,28 @@ for existence of the file before you try to load it, but if the file is deleted potentially something PHP should resolve, but is one case where error suppression might seem like the only valid solution. +In a stock PHP system, the behavior of the error control operator is irreversible. There are no configuration settings which allow a suppressed error to be temporarily un-suppressed. + +However, [xDebug] has an `xdebug.scream` ini setting which will disable the error control operator. You can set this via your `php.ini` file with the following. + + xdebug.scream = On + +You can also set this value at runtime with the `ini_set` function + +{% highlight php %} +ini_set('xdebug.scream', '1') +{% endhighlight %} + +The "[Scream]" PHP extension offers similar functionality to xDebug's, although Scream's ini setting is named `scream.enabled`. + +This is most useful when you're you're debugging code and suspect an informative error is suppressed. Use scream with care, and as a temporary debugging tool. There's lots of PHP library code that may not work with the error control operator disabled. + + * [Error Control Operators](http://php.net/manual/en/language.operators.errorcontrol.php) * [SitePoint](http://www.sitepoint.com/) * [never suppress notices](http://www.sitepoint.com/why-suppressing-notices-is-wrong/) +* [xDebug](http://xdebug.org/docs/basic) +* [Scream](http://www.php.net/manual/en/book.scream.php) ### ErrorException From f3c0d537e8aa1d8343f627be63a39fb54b724432 Mon Sep 17 00:00:00 2001 From: Alan Storm Date: Mon, 17 Feb 2014 16:08:20 -0800 Subject: [PATCH 2/2] Adding scream information, fixing typo --- _posts/08-02-01-Errors.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/08-02-01-Errors.md b/_posts/08-02-01-Errors.md index eb4d073..1410529 100644 --- a/_posts/08-02-01-Errors.md +++ b/_posts/08-02-01-Errors.md @@ -103,7 +103,7 @@ ini_set('xdebug.scream', '1') The "[Scream]" PHP extension offers similar functionality to xDebug's, although Scream's ini setting is named `scream.enabled`. -This is most useful when you're you're debugging code and suspect an informative error is suppressed. Use scream with care, and as a temporary debugging tool. There's lots of PHP library code that may not work with the error control operator disabled. +This is most useful when you're debugging code and suspect an informative error is suppressed. Use scream with care, and as a temporary debugging tool. There's lots of PHP library code that may not work with the error control operator disabled. * [Error Control Operators](http://php.net/manual/en/language.operators.errorcontrol.php)