Software is built upon a lot of other utilities many times from other projects. PHP is a huge item with so many parts and requires a lot of support utilities from other projects. Homebrew is just taking all the open source code and providing relatively easy access to installing these projects. Unless you are willing to pay someone else to provide you with a full binary package made for macOS, then you must deal how Homebrew works.
Here is information about the Homebrew PHP formula which shows its dependencies with several parts requiring downloading & compiling portions from the source code with the latter requiring lots of time.
https://formulae.brew.sh/formula/php
There is also a possibility some of those dependencies may have their own dependencies.