Derick Rethans wrote:
> On Mon, 24 Aug 2009, Rasmus Lerdorf wrote:
>> Lukas, the problem is that all messages, E_STRICT, E_DEPRECATED,
>> E_NOTICE, whatever, all cause a performance hit even if the
>> error_reporting level is such that they will never show up anywhere.
>> That's what this patch is trying to address.  To write optimal code,
>> they have to be entirely clean of all messages including E_DEPRECATED
>> and E_STRICT.
> 
> And how exactly is that a problem? Sure, there are some cases where PHP 
> functions are too noisy, but that should be addressed instead.

You are making the assumption that everybody agrees on E_NOTICE,
E_STRICT and E_DEPRECATED being things to be fixed in your code. That is
not the case and punishing people for not following exactly the same
coding style as you doesn't make sense when it could easily be avoided.

Background info: We decided to patch PHP to not generate E_NOTICE for
undefined variables or (worse) array offsets because we use this
language feature a lot and cannot afford the overhead caused by
E_NOTICEs even if error_reporting is set to ignore E_NOTICE. And you
won't be able to convince us to change this policy because being able to
do things like
        if (!$visited[$city]++)
is more valuable (i.e. keeps the code uncluttered) to us than the
E_NOTICE. We use http://cschneid.com/php/phplint.php (in a commit hook)
instead to catch typos. It's not perfect but does the job for us.

Summary: Don't punish different coding styles unless really necessary.

Cheers,
- Chris

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to