Re: Re: Silencing @
| From: | Ian Eure | Date: | Tue, 01 Nov 2005 17:04:32 +0000 |
| Subject: | Re: Re: Silencing @ | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.pear.qa |
| Request: | Send a blank email to pear-qa+get-3211@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Oct 31, 2005, at 9:05 PM, Justin Patrin wrote:
I am always being bitten by @ silencing includes where I have a parse error. I have to dig down into the code to find the offending call and un-silence it. Ugh. Yes, "blank page syndrome" is why this should be introduced. Agreed.
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) iD8DBQFDZ6AgxuUdPD6j2IMRAo4UAJ9YIfJx1wJMVxscdEW87ePmZpesegCg4+8K laG8QgMGc/7yyK7YAxkHC78= =iNDM -----END PGP SIGNATURE-----I've certainly never needed to iterate over the include_path for cases like that. Have you run into scenarios where this is necessary?There are 2 schools of thought on this. 1 is factories / includes should never create a PHP error. This leads to either silencing the call with @ (horrible) or iterating over the include_path (inefficient). The other is just to let the PHP error happen like normal. I'm currently for the second option. If an include fails it's more of a development / installation issue. It should show up as a normal PHP error and be dealt with like a normal PHP error (same as a parse error). In production, this is easy enough to silence with error_reporting and easy enough to catch with an error handler. IMHO there's no need for extra include_path and file_exists processing when PHP is doing it for us. I'm also picking door #2, unless an adherent of the "errorless factory" school of thought can chime in with some reason why that's a good thing.