Here's a "crazy" idea....Interpreter Directives?
| From: | Sina Iman | Date: | Sat, 14 Aug 2004 00:55:30 +0000 |
| Subject: | Here's a "crazy" idea....Interpreter Directives? | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-25794@lists.php.net to get a copy of this message | ||
Would it be possible to have, in future releases of PHP, "interpreter
directives"? What I mean is like compiler direcives in C++, but in
php it would just specify the version of php you want your script to
be parsed by.
For example:
(the syntax is just an example of what it could be, and how cool it
would look :) )
<?php :: Global-Lang: PHP 4.3.8 // Globally parse the document as php 4.3.8
$str = strlen("hello") :: Lang: PHP 5.1.0; // parse functions on this
line as php 5.1.0
?>
And this would make a script that would normally be parsed as a php 5
script parsed as a php 4.3.8 script.
This way developers could experiment with different function
definitions from other versions of php to see if they work
better/faster/differently
A totally recompiled version of php encompassing older versions would
be required, of course, and it probably would effect performance a
bunch, but I think it would be really cool for developing and testing
applications.
This would be very interesting if possible to do, what do you guys think?
Thanks,
Sina