Q:

Symfony 3 unit tests pass locally but not at Travis

I have a Symfony 3 project with tests that pass in php 5.5 & 5.6 but fail in 7.0 and 7.1. All the same tests pass when using Symfony 2.8. All tests pass locally but some fail on travis.
shows failing tests: https://travis-ci.org/zikula/core/builds/257745627
travis file: https://github.com/zikula/core/blob/master/.travis.yml#L40
I’m hoping someone here will have some insight. I’m pretty much at a complete loss.
originally in the Travis file I just ran phpunit and it was passing until very recently where I started to get errors like reported here (https://github.com/symfony/symfony/issues/19532) e.g. YamlFileLoader - Undefined class constant 'PARSE_CONSTANT'
so I tried both ./src/vendor/symfony/symfony/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit and bin/pnpunit (current setting) and they both fail (but differently!)
as it is currently set up I get these errors before the tests fail:

$ ./bin/phpunit
  PHP Warning:  PHP Startup: Unable to load dynamic library '/home/travis/.phpenv/versions/7.0.7/lib/php/extensions/no-debug-zts-20151012/apc.so' - /home/travis/.phpenv/versions/7.0.7/lib/php/extensions/no-debug-zts-20151012/apc.so: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/home/travis/.phpenv/versions/7.0.7/lib/php/extensions/no-debug-zts-20151012/apc.so' - /home/travis/.phpenv/versions/7.0.7/lib/php/extensions/no-debug-zts-20151012/apc.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/home/travis/.phpenv/versions/7.0.7/lib/php/extensions/no-debug-zts-20151012/memcache.so' - /home/travis/.phpenv/versions/7.0.7/lib/php/extensions/no-debug-zts-20151012/memcache.so: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/home/travis/.phpenv/versions/7.0.7/lib/php/extensions/no-debug-zts-20151012/memcache.so' - /home/travis/.phpenv/versions/7.0.7/lib/php/extensions/no-debug-zts-20151012/memcache.so: cannot open shared object file: No such file or directory in Unknown on line 0

So I am guessing this is related because I do not get those errors locally or in php 5.5/5.6
any ideas how to solve this? Thanks in advance!

A:

Firstly, composer run on PHP 7 might bring different versions of dependencies than if it was run on PHP 5. This is because many packages are dropping PHP 5 support these days. Perhaps you're fetching a dependency that behaves differently on PHP 7.
Another option is that your code behaves differently on PHP 7. For example, if failures you're getting are related to sorting, it might be that your algorithm sorts in a slightly different way depending on a PHP version it's run on.

