Re: Compatibility problems with PHP 5
| From: | Stig S. Bakken | Date: | Wed, 03 Dec 2003 11:01:23 +0000 |
| Subject: | Re: Compatibility problems with PHP 5 | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-6064@lists.php.net to get a copy of this message | ||
On Tue, 2003-12-02 at 12:51, Andi Gutmans wrote:
> At 11:40 PM 12/1/2003 +0100, Stig S. Bakken wrote:
> >For the next 18-24 months, we are going to have to deal with code
> >running in both PHP 4 and 5. Why not declare "var" an alias for
> >"public", not throw E_STRICT for it and be done with it? If not this
> >issue will be a real PITA for PEAR users.
>
> Stig,
>
> E_STRICT will be disabled by default. It is only meant for people who want
> to be sure that they are using the recommended methods, and that definitely
> includes not using var.
> People who don't feel like it don't need to use it. It'd be ridiculous to
> have two new pedantic modes just because of this. It's not as if there are
> so many things we can recommend on anyway.
I guess the core of the problem here is if E_STRICT is included in
E_ALL. PEAR developers are encouraged to write E_ALL safe code.
Changing that to "E_ALL & ~E_STRICT" doesn't work, because E_STRICT does
not exist in PHP 4.
The goal here is to assure smooth transition from PHP 4 to PHP 5 for
PEAR users. To me that means not having to use version_compare() or
have different versions of files for PHP 4 and 5.
Solutions that would work for PEAR:
* E_ALL not including E_STRICT
* "var" equivalent to "public" (ie not throwing E_STRICT)
- Stig