Re: PHP5->4 stripper.. was Re: [PEAR-DEV] Re: Version documentation...
| From: | Greg Beaver | Date: | Fri, 30 Apr 2004 15:23:06 +0000 |
| Subject: | Re: PHP5->4 stripper.. was Re: [PEAR-DEV] Re: Version documentation... | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-28638@lists.php.net to get a copy of this message | ||
Alan Knowles wrote:
This does bring up an interesting issue.. how feasible is stripping packages which use PHP5 specific coee, on install, to be PHP4 compatible...?? Assuming the php4 tokenizer reads php5 files ok.. Things that should be possible. = replace privates/protected etc. on vars/ methods.. = remove type hinting on method args. Things that are not really going to be possible... = recognising code taking advantage on non-cloning behavior = exceptions... Can anyone think of other issues.. It would make migration considerably easier... for users and developers..It wouldn't be possible. You'd have to check for all uses of php5-specific classes like Reflection and any use of simplexml would be impossible to change. It's a neat idea, actually, if developers stuck to only using the language features and not the guts of php5. I believe the best solution to the php4/php5 conundrum is in fact to add a dependency section to the channels proposal. A channel is basically a namespace, so if you add a dependency on php5, it would tell the installer "this namespace is only valid in php5." Of course, this idea might not work in PEAR due to inertia, but I'm sure it would in an ideal world, and maybe even in a near-to-ideal world :). Greg