A Flash perspective on PHP releases

It strikes me as odd that the uptake of PHP5 has been so slow. The snail’s pace at which web hosts are migrating to PHP5 has been hampered not by lack of user interest, but because a few popular PHP applications (OSCommerce, for one) break under PHP5. In this respect, I suppose the web host’s hands are tied.


Coming from a Flash background, where upgrades to the authoring program, programming language and player are frequent, I wonder whether PHP might have something to learn from Flash.

The Flash Player is backwards compatible with old Flash content. Flash Player 8 will play content published in Flash 6 format, even though the two have a vastly different programming language (Actionscript 1.0, and Actionscript 2.0). This can be achieved because a Flash swf contains metadata identifying its minor and major version. As soon as the Flash Player opens a swf file, it can check to see what version of Flash player it has been published for, and treat the swf accordingly.

Why can’t a PHP file have similar metadata? For instance, a PHP file might begin:

<?php4

Identifying to the rendering engine to treat the file as PHP4. If a version identifier wasn’t present, it would treat the file as belonging to the latest version.

OK, so I admit I know next to nothing about the inner workings of PHP, and the solution I’ve outlined may be totally impossible to implment. But you can’t blame a frustrated user for taking a stab!