If you think about it, all of the applications I mentioned have tens
of thousands of lines of side, some hundreds of thousands.
That's actually fairly small. There are projects out there with millions, even tens of millions of lines of code.
Yet they seem to have a fairly light footprint despite the huge
amounts of code that must be run through the PHP interpreter for each
and every request.
Often the code is only parsed once and the resulting bytecode stored in a cache (e.g. Xcahe, APC). So, all those lines do not have to be interpreted every request.
Also, not all the code needs to be executed every request.
Usually, the bulk of the time it takes a web application respond is database access and data transfer (either from the database to PHP, and from PHP though the webserver to your application).