Re: svn: /pear/packages/Log/trunk/ package.php package.xml
| From: | Rasmus Lerdorf | Date: | Mon, 28 Dec 2009 22:16:18 +0000 |
| Subject: | Re: svn: /pear/packages/Log/trunk/ package.php package.xml | ||
| References: | 1 2 3 4 5 | Groups: | php.pear.cvs php.pear.dev |
| Request: | Send a blank email to pear-dev+get-53173@lists.php.net to get a copy of this message | ||
Jon Parise wrote:
> On Mon, Dec 28, 2009 at 10:37 AM, Rasmus Lerdorf <rasmus@lerdorf.com> wrote:
>
>>> PHP5 introduced a deprecation warning for the '$a = &new' syntax that
>>> worked in (and is required by?) PHP4. Because this warning is emitted
>>> at compile-time, the syntax can't be conditionally based on a
>>> version_compare() result (which is how I work around the other PHP4
>>> vs. PHP5 incompatibilities).
>>>
>>> This warning is only emitted under E_STRICT, but I don't think it's
>>> reasonable to continue asking all PHP5 users of the PEAR Log package
>>> to disable E_STRICT reporting.
>> Keep in mind that E_STRICT is not part of E_ALL, so people who have it
>> on have explicitly enabled it.
>
> I was mistaken. The warning is tagged as E_DEPRECATED, which is part of E_ALL.
>
> These are the recommended error_reporting levels:
>
> ; Default Value: E_ALL & ~E_NOTICE
> ; Development Value: E_ALL | E_STRICT
> ; Production Value: E_ALL & ~E_DEPRECATED
>
> ... so end-users tend to see this everywhere except in production
> (assuming they follow these recommended values).
The other thing to check is why exactly you need a reference to the
object. Are you passing it around and changing properties in it or
something? Seems to me like it would be cleaner if you used some access
methods to modify the object as opposed to passing it around by
reference in PHP 4.
-Rasmus