Re: Re: [PEPr] Comment on PHP::PHP_Compatibility
| From: | Stefan Neufeind | Date: | Fri, 20 Feb 2004 10:09:07 +0000 |
| Subject: | Re: Re: [PEPr] Comment on PHP::PHP_Compatibility | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-25739@lists.php.net to get a copy of this message | ||
On 20 Feb 2004 at 9:24, Davey wrote:
> Pepr wrote:
> > Stefan Neufeind (http://pear.php.net/user/neufeind) has commented on
> > the proposal for PHP::PHP_Compatibility.
> >
> > Comment:
> >
> > Though I haven't yet had time for a test, as we've already discussed
> > I'm much in favor of such a package. It would be a nice option to be
> > able to check which lines of code make it dependent on certain
> > versions, so that it's just one call that demands latest php-release
> > and everything else will run fine under 4.2.0 you have a chance to
> > maybe workaround that one line to be far more compatible with not
> > too much work (where possible).
> >
> > Proposal information:
> > http://pear.php.net/pepr/pepr-proposal-show.php?id=27
> >
>
> Stefan,
>
> Narrowing it down to the line is impossible from tokens, AFAIK,
> HOWEVER I could make it keep an array like:
>
> functions => array('4.1.0' =>
> array('some_func_added_in_4.1.0','foo'),
> '4.3.0' => array('some_func_added_in_4.3.0','bar'));
>
> It could *even* create an array of things that won't run on the
> current install... either because the extension isn't loaded or
> because the version doesn't have X functions.
>
> I also want to make it check for constants like __FILE__ and __LINE__
> - and what about superglobals? I think that may be too costly.
Narrowing it down "to the line" is not really needed, I agree. But
*optionally* generating an array of PHP-functions that demand a
certain version would be a nice idea imho. For sure it would be
useful to be able to set a lower limit - e.g. starting only show
functions which need php >4.2.0, since PEAR itself, as Pierre pointed
out shortly ago, already needs 4.2.0. This way I could simply set the
minimum a bit higher and only get the "interesting" results for me.
Maybe also a counter would be useful (function used in XX lines) to
be able to see at a glimpse which function demands php 4.3.5 and is
only used once or all-over in the code.
PS: Shouldn't these comments have taken please inside PEPr? I know
that a discussion using PEPr is out of scope, but it would be nice to
have these threads associated with the proposal somehow ...
Stefan