I am trying to make this feature available, maybe in an apache .htaccess file.
My understanding is that everything in PHP 4 is in PHP 5, so if you install PHP 5 and configure it, you will be able to use all features in both 4 and 5.
My web host (1&1) does this; to use php5 I have to use .php5 extensions or add an .htaccess command to use php5 for my .php files.
I would think it's simply a matter of installing php4 and php5 to separate directories and telling apache to interpret .php files with php4 and .php5 files with php5.
If you are using a control panel application on your server such as cPanel, this can probably already handle this for you.
If you are on a bare server, simply have PHP 5 run using one method (e.g. DSO) and have PHP 4 run using a different method (e.g. SuPHP). You can then use a .htaccess file to determine which version of PHP to use or just have .php for PHP 5 and .php4 for PHP 4 files.
However, there is a huge overlap between PHP 4 and PHP 5. The only major difference I can think of offhand that one would likely encounter is XML processing.
I used the virtual server config to setup several folders with PHP5 and some with PHP4 on my PC to test code. I also set them up with different hostnames (also in the windows host file). (I dont have access to that machine anymore, but here is what I remember.)
Just include one of the following (for linux)
AddHandler php4 .php
Action php4 /cgi-bin/php4
or
AddHandler php5 .php
Action php5 /cgi-bin/php5
in the virtual server config.
If you want to use them for the same (virtual) server, one of the file extensions would have to be renamed to .php5, .php4 or similar.