How do I get deprecated packages?

Homebrew will only let me install phpunit 8.0 with php 7+, I don’t have a clue about taps and all the other stuff. It used to just work for me with php 5.x and phpunit 6.1.4, now I have a new laptop, nothing works and it won’t install what I need. Upgrading this legacy piece of software just because homebrew has decided to stop me from downloading it is out of the question as I just need to fix a bug for a client.

How can I get all the previous packages I had using homebrew without having to update the whole application?

You can’t. Homebrew only supports versions that are supported by upstream and PHP 5.6 and phpunit 6 are no longer supported. Your best bet is finding some community tap that supports these versions.