Skip to content

Instantly share code, notes, and snippets.

@tox2ik
Created February 12, 2021 00:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tox2ik/8bafc9132fec4200312bc65005aec99c to your computer and use it in GitHub Desktop.
Save tox2ik/8bafc9132fec4200312bc65005aec99c to your computer and use it in GitHub Desktop.
enumerate php extension-api date-versions
git clone https://github.com/php/php-src.git
cd php-src
git tag \
| grep -Eo 'php-([0-9]+\.?){3}$' \
| sort -ut. -k1.5,1n -k2,2n -k3,3n \
| while read tag; do
echo $tag `
git show $tag:main/php.h | sed -n ' /#define PHP_API_VERSION /{ s///; p; q } '
` `
git show $tag:main/php_version.h | sed -n " /#define PHP_VERSION /{ s///; s/[\"']//g; p; q } "
`
done \
| awk '{ ap[$2]=$0 } END { for (i in ap) { print ap[i] } }' \
| column -t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment