sync-dir recursively runs php -l on every file in the directory it's syncing, and also descends into the vendor directory. And apparently we have a file with invalid syntax there.
Fatal error: syntax error, unexpected T_CONST, expecting T_VARIABLE in /srv/mediawiki-staging/php-1.32.0-wmf.10/vendor/psy/psysh/test/ClassWithSecrets.php on line 16
This makes it impossible to use scap sync-dir php-1.32.0-wmf.10 as a workaround for scap sync when deploying a change that touches multiple top-level directories (e.g. includes/ and resources/) but doesn't otherwise need a full scap (doesn't touch i18n etc).