PHP version tracker has a 20 millions domain name database that he scans every month. For each web site, it retrieve the headers from the main page, using the HEAD HTTP command. Then, from those headers, it gathers information about PHP adoption in the world, and some other stats.