It depends 100% on where you want to get your statistics from.
If you want to analyze a webserver log, don't use php, use a compiled binary.
If you have the log in a database, PHP is good for getting the results from queries and creating graphs to show the stats.
If you want a hitcounter for your page... I'd allmost say "grow up" :-) but yes, PHP can be used for that too.