Specifically the latest symfony/process changed the way it determins isTtySupported, seems stream_isatty(\STDOUT) is returning false when it should not.
This can be circumvented by:
"-T Disable pseudo-TTY allocation. By default docker compose exec allocates a TTY."
docker compose exec -T web php ./vendor/bin/phpunit