Skip to content

Instantly share code, notes, and snippets.

@mikedamoiseau
Last active September 13, 2022 04:53
Show Gist options
  • Save mikedamoiseau/40d50605624e73ea001af2373016a44f to your computer and use it in GitHub Desktop.
Save mikedamoiseau/40d50605624e73ea001af2373016a44f to your computer and use it in GitHub Desktop.
Test the compatibility of source code with a given version of PHP

Execute in the terminal:

docker run --rm -ti -v ./html:/app php:8.0 bash

Then:

find /app -name '*.php' | xargs -n1 /usr/local/bin/php -l > /app/reportphp8
@mikedamoiseau
Copy link
Author

Use the absolute path instead of ./html if you get this error:

docker: Error response from daemon: create ./html: "./html" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path.
See 'docker run --help'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment