It may be a challenging road but I believe it is possible although it may come with a significant cost of time.
Basically, migrate from ZF2 then migrate to ZF3.
Or, if you just want the PHP7 speed ups, just upgrade to PHP7 and do some lint testing which may uncover some (but not all) bugs.
Read on for more...
Migrate to ZF2 first
https://framework.zend.com/manual/2.1/en/migration/overview.html
- Tools for namespacing your code.
- Tools for consuming Zend Framework 2 within your Zend Framework 1 application.
- Strategies for running Zend Framework 2 and Zend Framework 1 in parallel.
- Strategies for making your code easier to migrate, focussing primarily on clean separation of your domain logic and the MVC layer.
- Strategies for migrating the MVC layer.
- Strategies for migrating your domain layer.
Then, migrate to ZF3:
Zend Framework v2 to v3 has been intended as an incremental upgrade. We have even made efforts in the past year to provide forwards compatibility features in v2 versions of components, to allow users to prepare their code for upgrade.
This is not a comprehensive migration guide, however. While we know the majority of the areas where breakage can and will occur, we also know that only when developers are actually updating will we see the full situation. As such, treat this as a work in progress, and please feel free to propose updates or changes via issues or pull requests so we can improve!
https://docs.zendframework.com/tutorials/migration/to-v3/overview/
I'd imagine there is a significant amount of breakage due to the significant changes from ZF to ZF2 might have.
But, you can run ZF1 and ZF2 in parallel:
https://framework.zend.com/manual/2.4/en/migration/zf1_zf2_parallel.html
From a technical point of view it is absolutely possible to run ZF2 in parallel with ZF1 because there is no conflict between the classnames due to the fact that ZF2 uses namespaces and ZF1 does not. Running ZF1 and ZF2 in parallel can be used as a migration strategy in projects where it is not possible, or not convenient, to migrate an entire application from ZF1 to ZF2. For instance, you could implement any new features of the application using ZF2, while maintaining original ZF1 features.
It is unknown to me whether ZF1 and ZF3 can be run in parallel but perhaps not impossible.
Or, just try it out with PHP7
If it was me, I might just try upgrading to PHP7 first and look for any breakages in the code.
You can run something similar to the following to lint test your PHP code against PHP7:
find . -name "*.php" -print0 | xargs -P 8 -n 1 -0 sh -c '/usr/local/Cellar/php70/7.0.0/bin/php -l $0 || true' | grep -v 'No syntax'
If you're on a Mac you can use the PHP version switcher by installing it with brew.
brew install brew-php-switcher
You may need to comment out this line in your httpd.conf:
#LoadModule php5_module libexec/apache2/libphp5.so
then :
brew install php71
Add this line to your httpd.conf:
<FilesMatch .php$>
SetHandler application/x-httpd-php
</FilesMatch>
Switch versions:
brew-php-switcher 71