This is the opposite question of this one. My purpose is that there is no need when you write only PHP5 code to have PHP4 compatibility. It is not helpful at all and due to differences between object models in those two version, it must be penalizing on interpreter performances (or am I wrong ?).
So my questions are :
- is it possible to recompile PHP5 without retrocompatibility with PHP4 or to disable it in any other way to gain performances ?
- if it is not possible, is there a project somewhere which aim that goal ?
It's not possible because there is no need; everything (except for a small number of items) in PHP4 is basically a subset of PHP5. So the PHP developers didn't need to separately create a "compatibility mode" in order for PHP5 to run PHP4 code. It's sorta like, if the NBA suddenly changed the size of a regulation basketball hoop to be 2" wider in diameter, it would still automatically be 'backward compatible' with existing basketballs.
Anything that was going to be removed in PHP5 was already deprecated in PHP4, so properly written PHP4 scripts should run just fine in PHP5 with only minor modifications. The biggest "losses" aside from deprecated PHP3 features are extensions which are no longer included in a standard install of PHP5.
And the new object model has replaced the old one from PHP4, but aside from changing the copying quirks of objects, the differences between the object models are mostly in the implementation. So, again, most PHP4 scripts are likely to work in PHP5 with only minor modifications. And there is not explicit backward compatibility feature to be disabled.
So this is not an area of optimization worth worrying about. You would accomplish more by optimizing your PHP5 code and using Memcached or APC. And if you want to make PHP reject the use of deprecated code (to make your code future-proof rather than as a server-optimization), then just use the
E_STRICT
error-reporting setting.