Since PHP 7.2
is not supported anymore, it's got delisted from the Hombrew core repository.
You've to find a third-party repository that still contains an older PHP version, such as the shivammathur/php
repository.
You need to tap the repository like this in your Homebrew:
brew tap shivammathur/php
Then you can install PHP 7.2
like this:
brew install shivammathur/php/php@7.2