In order to do ongoing rigorous testing of the ported PHP code, we are building facilities into Parsoid that let us splice in PHP transformations in place of JS transformations in the Parsoid pipeline. So, this hybrid pipeline will run JS and PHP code as part of parsing a page. This lets us get early and regular feedback on ported code by using the Parsoid/JS code as a environment mocking wrapper around the constantly growing ported PHP code.
https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/483212 is the first work in progress patch for this.
Since the PHP and JS code live side by side in the Parsoid repository, the only blockers to doing this (once the patches are ready and merged) would be:
(a) availability of PHP7 on scandium
(b) installation of PHP dependencies: This could possibly be done similar to node_modules in the Parsoid deploy repository .... but we need to figure out whether we end up any binary dependencies which would make this harder.
This task is for discussing and work in the first piece -- installing PHP7 on scandium. This would require puppetization work.
Once we resolve that this is a good approach and figure out how (b) would work, we can tag ops and proceed with this.