Travis-CI build jobs only uses PHP 7.2 instead of 5.6-7.4
Issue Summary
During reviewing the failure of my last PR (which was caused by expired certificate, but is solved), I discovered that every build job was executing using PHP 7.2(.15).
Issue introduced by #960 which uses different configuration.
See build job log which sets 'version=7.4' environmental variable (which is last entry in env block of .travis.yml):
Setting environment variables from .travis.yml
$ export version=7.4
But instead of reuse this environment variable, default (?) 7.2 is assigned via phpenv global and used.
$ phpenv global 7.2 2>/dev/null
pearrc
Writing /home/travis/.pearrc
$ phpenv global 7.2
[...]
$ php --version
PHP 7.2.15 (cli) (built: Feb 11 2019 23:22:17) ( ZTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.15, Copyright (c) 1999-2018, by Zend Technologies
with Xdebug v2.6.1, Copyright (c) 2002-2018, by Derick Rethans
Happens when filing a PR using up-to-date master branch.
The Travis env PHP version is not really used. The version env var determines which PHP docker image to pull which is where the tests actually get run. Referenced in the Dockerfile here: https://github.com/sendgrid/sendgrid-php/blob/master/Dockerfile#L2
The php --version command output in the build log was confusing me, but I'm confident the right version is selected although it isn't shown clearly.
Used logs of version 7.4:
Step 1/9 : ARG version=latest
Step 2/9 : FROM php:$version
7.4: Pulling from library/php
[...]
Status: Downloaded newer image for php:7.4
In addition to this, the PR I've created has conditional tests for PHP>=7.1. In the 5.6 and 7.0 version logs a few assertions have been skipped.
Sorry for this confusion - will close it because it's not a bug :)