Mixing PHP4 and PHP5 within a single app
I maintain for someone code of an old PHP4 app. Since certain new features could make good use of ZEND framework, I wonder, if I could mix PHP4 and PHP5 within a single app.
To be more specific, I'd like to call PHP5 code from wit开发者_如何学Gohin PHP4 code.
A simple solution would be a new directory XXX, which holds the new PHP5 stuff. Then call from within PHP4 classes PHP5 code using HTTP sub-requests. Since the features in question are seldom used administrative functions, this approach shouldn't throttle the overall performance.
Alternatively, I wonder, if I may include files from the PHP5 world from within PHP4 scripts directly.
Most likely, this isn't possible, since the web-server runs PHP4 and PHP5 in separate processes/address spaces.
In case I missed something, could someone confirm? Or point into another direction?
The only way this could be done is by enabling remote fopen() wrappers and invoking the PHP5 code by URL. This seems like a really Bad Idea.
精彩评论