How do PHP releases match “API=yyyymmdd” signature

2019-07-04 19:16发布

Is there a definite and reliable source to find out which PHP release version x.y.z carries/uses which "API=yyyymmdd" signature/tag?

2条回答
老娘就宠你
2楼-- · 2019-07-04 19:19

The version control repository of PHP is the authoritative source on the correlation between PHP releases and their API date-versions.

Assuming bash

Fetch PHP.

git clone https://github.com/php/php-src.git
cd php-src

list of relevant tags

tags() {
    git tag |
    sed -En ' /(RC|alpha|beta)/d ; /php-5/p ; ' | 
    sort -t. -k1,1n -k2,2n -k3,3n
}

some 270 log entries for main/php.h (where API version is defined).

go_crazy() {
    git log  main/php.h | 
    awk '/^commit / { print $2 }' | 
    tac
}

match relevant lines and remove cruft.

api() { 
    sed -n ' /#define PHP_API_VERSION /{
        s///; p; q } ' main/php.h
}

php_version () { 
    sed -n " /#define PHP_VERSION /{ 
        s///; 
        s/[\"']//g; 
        p; q 
    } " main/php_version.h
}

do the doo!

for i in `tags`
do

    git co -f $i
    echo $i `api`

done  > /tmp/tag.apis; 

for i in `go_crazy`
do

    git co -f $i
    echo `php_version` `api`

done > /tmp/many.versions

Results

$ awk '{ print $2, $1 }' /tmp/many.versions /tmp/tag.apis  | sort -u -k1,1
19990421 4.0pa1
20010119 4.0.5-dev
20010901 4.0.8-dev
20020307 4.3.0-dev
20020918 4.3.0-dev
20030518 5.0.0-dev
20030820 5.0.0b2-dev
20031103 5.0.0b3-dev
20031224 5.0.0RC1-dev
20041225 5.1.0-dev
20090626 5.3.0
20100412 5.3.99-dev
20121113 5.5.0-dev
20131106 5.6.0-dev
20131218 5.7.0-dev
 4.0pa1
 php-5.0.1b1

For the curious

Versions starting with php- are git tags and presumably official releases.

$ awk 'NF==2 { print $2, $1 }' /tmp/tag.apis /tmp/many.versions  | sort 

19990421 4.0.0
19990421 4.0.1
19990421 4.0.1-dev
19990421 4.0.1-dev
19990421 4.0.1-dev
19990421 4.0.1-dev
19990421 4.0.1-dev
19990421 4.0.1-dev
19990421 4.0.1-dev
19990421 4.0.1-dev
19990421 4.0.1-dev
19990421 4.0.1-dev
19990421 4.0.1-dev
19990421 4.0.1-dev
19990421 4.0.2
19990421 4.0.2
19990421 4.0.2-dev
19990421 4.0.2-dev
19990421 4.0.2-dev
19990421 4.0.2-dev
19990421 4.0.2-dev
19990421 4.0.2-dev
19990421 4.0.2-dev
19990421 4.0.2-dev
19990421 4.0.2-dev
19990421 4.0.2-dev
19990421 4.0.2-dev
19990421 4.0.2-dev
19990421 4.0.2-dev
19990421 4.0.2-dev
19990421 4.0.2-dev
19990421 4.0.2-dev
19990421 4.0.3-dev
19990421 4.0.4-dev
19990421 4.0.4-dev
19990421 4.0.5-dev
19990421 4.0.5-dev
19990421 4.0B1
19990421 4.0B2
19990421 4.0b2-dev
19990421 4.0b2-dev
19990421 4.0b2-dev
19990421 4.0B3-dev
19990421 4.0B3-dev
19990421 4.0B3-dev
19990421 4.0B3-dev
19990421 4.0B3-dev
19990421 4.0B3-dev
19990421 4.0B3-dev
19990421 4.0B3-dev
19990421 4.0B3-dev
19990421 4.0B3-dev
19990421 4.0B3-dev
19990421 4.0B3-dev
19990421 4.0B3-dev
19990421 4.0B3-dev
19990421 4.0B3-dev
19990421 4.0B3-dev
19990421 4.0B3-RC2
19990421 4.0b3-RC5
19990421 4.0b3-RC5
19990421 4.0b4-dev
19990421 4.0b4-dev
19990421 4.0b4-dev
19990421 4.0b4-dev
19990421 4.0b4-dev
19990421 4.0b4-dev
19990421 4.0b4-dev
19990421 4.0b4-dev
19990421 4.0b4-dev
19990421 4.0b4-dev
19990421 4.0b4-dev
19990421 4.0b4-dev
19990421 4.0b4-dev
19990421 4.0b4-dev
19990421 4.0b4-dev
19990421 4.0b4-dev
19990421 4.0b4-dev
19990421 4.0b4-dev
19990421 4.0b4-dev
19990421 4.0b4-dev
19990421 4.0b4-rc1
19990421 4.0b5-dev
19990421 4.0b5-dev
19990421 4.0b5-dev
19990421 4.0b5-dev
19990421 4.0b5-dev
19990421 4.0b5-dev
19990421 4.0b5-dev
19990421 4.0pa1
19990421 4.0pa1
19990421 4.0pa1
19990421 4.0pa1
19990421 4.0pa1
19990421 4.0pa1
19990421 4.0pa1
19990421 4.0pa1
19990421 4.0pa1
19990421 4.0pa1
19990421 4.0pa1
19990421 4.0pa1
19990421 4.0RC1
19990421 4.0RC1
19990421 4.0RC2
19990421 4.0RC2-dev
19990421 4.0RC2-dev
19990421 4.0RC2-dev
19990421 4.0RC2-dev
19990421 4.0RC2-dev
19990421 4.0RC2-dev
19990421 4.0RC2-dev
19990421 4.0RC2-dev
19990421 4.0RC2-dev
19990421 4.0RC2-dev
19990421 4.0RC2-dev
19990421 4.0RC2-dev
19990421 4.0RC2-dev
19990421 4.0RC2-dev
19990421 4.0RC2-dev
19990421 4.0RC2-dev
19990421 4.0RC2-dev
20010119 4.0.5-dev
20010119 4.0.5-dev
20010119 4.0.5-dev
20010119 4.0.5-dev
20010119 4.0.5-dev
20010119 4.0.6-dev
20010119 4.0.6-dev
20010119 4.0.6-dev
20010119 4.0.7-dev
20010119 4.0.7-dev
20010119 4.0.7-dev
20010119 4.0.7-dev
20010119 4.0.7-dev
20010119 4.0.7-dev
20010119 4.0.7-dev
20010119 4.0.7-dev
20010119 4.0.7-dev
20010119 4.0.7-dev
20010119 4.0.7-dev
20010119 4.0.7-dev
20010119 4.0.7-dev
20010119 4.0.7-dev
20010119 4.0.7-dev
20010119 4.0.7-dev
20010119 4.0.7-dev
20010901 4.0.8-dev
20010901 4.0.8-dev
20010901 4.0.8-dev
20010901 4.2.0-dev
20010901 4.2.1-dev
20010901 4.2.1-dev
20010901 4.2.1-dev
20010901 4.2.1-dev
20010901 4.2.1-dev
20010901 4.2.1-dev
20010901 4.3.0-dev
20010901 4.3.0-dev
20010901 4.3.0-dev
20010901 4.3.0-dev
20010901 4.3.0-dev
20020307 4.3.0-dev
20020307 4.3.0-dev
20020307 4.3.0-dev
20020307 4.3.0-dev
20020307 4.3.0-dev
20020307 4.3.0-dev
20020307 4.3.0-dev
20020307 4.3.0-dev
20020918 4.3.0-dev
20020918 4.4.0-dev
20020918 4.4.0-dev
20020918 5.0.0-dev
20020918 5.0.0-dev
20020918 5.0.0-dev
20020918 5.0.0-dev
20020918 5.0.0-dev
20020918 5.0.0-dev
20020918 5.0.0-dev
20030518 5.0.0b2-dev
20030518 5.0.0b2-dev
20030518 5.0.0-dev
20030518 5.0.0-dev
20030518 5.0.0-dev
20030518 php-5.0.0b1
20030820 5.0.0b2-dev
20030820 5.0.0b2-dev
20030820 5.0.0b2-dev
20030820 5.0.0b2-dev
20030820 5.0.0b2-dev
20030820 5.0.0b2-dev
20030820 5.0.0b2-dev
20030820 php-5.0.0b2
20031103 5.0.0b3-dev
20031103 php-5.0.0b3
20031224 5.0.0RC1-dev
20031224 5.0.0RC1-dev
20031224 5.0.0RC1-dev
20031224 5.1.0-dev
20031224 5.1.0-dev
20031224 5.1.0-dev
20031224 5.1.0-dev
20031224 5.1.0-dev
20031224 5.1.0-dev
20031224 php-5.0.0
20031224 php-5.0.0b4
20031224 php-5.0.1
20031224 php-5.0.2
20031224 php-5.0.3
20031224 php-5.0.4
20031224 php-5.0.5
20041225 5.1.0-dev
20041225 5.1.0-dev
20041225 5.1.0-dev
20041225 5.1.0-dev
20041225 5.1.0-dev
20041225 5.1.0-dev
20041225 5.1.0-dev
20041225 5.1.0-dev
20041225 5.1.0-dev
20041225 5.1.0-dev
20041225 5.1.0-dev
20041225 5.1.0-dev
20041225 5.1.2-dev
20041225 5.1.2RC2-dev
20041225 5.1.3-dev
20041225 5.1.3-dev
20041225 5.2.0-dev
20041225 5.2.0-dev
20041225 5.2.0RC4-dev
20041225 5.2.1-dev
20041225 5.2.1-dev
20041225 5.2.1RC2-dev
20041225 5.2.1RC2-dev
20041225 5.2.5-dev
20041225 5.3.0alpha2-dev
20041225 5.3.0alpha2-dev
20041225 5.3.0alpha2-dev
20041225 5.3.0alpha2-dev
20041225 5.3.0alpha2-dev
20041225 5.3.0alpha3-dev
20041225 5.3.0alpha4-dev
20041225 5.3.0-dev
20041225 5.3.0-dev
20041225 5.3.0-dev
20041225 5.3.0-dev
20041225 5.3.0-dev
20041225 php-5.1.0
20041225 php-5.1.0b1
20041225 php-5.1.0b2
20041225 php-5.1.0b3
20041225 php-5.1.1
20041225 php-5.1.2
20041225 php-5.1.3
20041225 php-5.1.4
20041225 php-5.1.5
20041225 php-5.1.6
20041225 php-5.2.0
20041225 php-5.2.1
20041225 php-5.2.10
20041225 php-5.2.11
20041225 php-5.2.12
20041225 php-5.2.13
20041225 php-5.2.14
20041225 php-5.2.15
20041225 php-5.2.16
20041225 php-5.2.17
20041225 php-5.2.2
20041225 php-5.2.3
20041225 php-5.2.4
20041225 php-5.2.5
20041225 php-5.2.6
20041225 php-5.2.7
20041225 php-5.2.8
20041225 php-5.2.9
20090626 5.3.0
20090626 5.3.3-dev
20090626 5.3.3-dev
20090626 5.3.3-dev
20090626 5.3.3-dev
20090626 5.3.3-dev
20090626 5.3.99-dev
20090626 php-5.3.0
20090626 php-5.3.1
20090626 php-5.3.10
20090626 php-5.3.11
20090626 php-5.3.12
20090626 php-5.3.13
20090626 php-5.3.14
20090626 php-5.3.15
20090626 php-5.3.16
20090626 php-5.3.17
20090626 php-5.3.18
20090626 php-5.3.19
20090626 php-5.3.2
20090626 php-5.3.20
20090626 php-5.3.21
20090626 php-5.3.22
20090626 php-5.3.23
20090626 php-5.3.24
20090626 php-5.3.25
20090626 php-5.3.26
20090626 php-5.3.27
20090626 php-5.3.28
20090626 php-5.3.3
20090626 php-5.3.4
20090626 php-5.3.5
20090626 php-5.3.6
20090626 php-5.3.7
20090626 php-5.3.8
20090626 php-5.3.9
20100412 5.3.99-dev
20100412 5.3.99-dev
20100412 5.3.99-dev
20100412 5.3.99-dev
20100412 5.3.99-dev
20100412 5.3.99-dev
20100412 5.5.0-dev
20100412 5.5.0-dev
20100412 5.5.0-dev
20100412 5.5.0-dev
20100412 5.5.0-dev
20100412 php-5.4.0
20100412 php-5.4.1
20100412 php-5.4.10
20100412 php-5.4.11
20100412 php-5.4.12
20100412 php-5.4.13
20100412 php-5.4.14
20100412 php-5.4.15
20100412 php-5.4.16
20100412 php-5.4.17
20100412 php-5.4.18
20100412 php-5.4.19
20100412 php-5.4.2
20100412 php-5.4.20
20100412 php-5.4.21
20100412 php-5.4.22
20100412 php-5.4.23
20100412 php-5.4.24
20100412 php-5.4.25
20100412 php-5.4.26
20100412 php-5.4.3
20100412 php-5.4.4
20100412 php-5.4.5
20100412 php-5.4.6
20100412 php-5.4.7
20100412 php-5.4.8
20100412 php-5.4.9
20121113 5.5.0-dev
20121113 5.5.0-dev
20121113 5.6.0-dev
20121113 5.6.0-dev
20121113 php-5.5.0
20121113 php-5.5.1
20121113 php-5.5.10
20121113 php-5.5.2
20121113 php-5.5.3
20121113 php-5.5.4
20121113 php-5.5.5
20121113 php-5.5.6
20121113 php-5.5.7
20121113 php-5.5.8
20121113 php-5.5.9
20131106 5.6.0-dev
20131106 5.6.0-dev
20131106 5.6.0-dev
20131106 5.6.0-dev
20131218 5.7.0-dev
20131218 5.7.0-dev
20131218 5.7.0-dev
查看更多
混吃等死
3楼-- · 2019-07-04 19:44

I've looked for such a thing in the past, but haven't found any really good sources. (Searching for some of the API versions shows a post I made a while back listing them as one of the top hits!) Here are all of the recent ones:

  • PHP 5.2: 20060613
  • PHP 5.3: 20090626
  • PHP 5.4: 20100525
  • PHP 5.5: 20120211
  • PHP 5.6: 20131226 (as of 5.6.0alpha3)
查看更多
登录 后发表回答