PHP 7.1 was released in December of 2016 and it is still unsupported on Toolforge.
There are now many frameworks and libraries that require at least support for PHP 7.0 and new libraries that only support PHP 7.1 (with plans to only support the latest version).
There is an "official" docker image for PHP 7.1 (as well as 7.0, etc.) that is maintained by the Docker community:
https://hub.docker.com/_/php/