Other than to use SVN to roll the whole tree back a few months (and freeze it there), there's no way.*
PHP 5.4 End-of-Life was 3 September 2015 and well publicized.
If you are using software that can't run on PHP 5.5, 5.6, or 7.0, I'd say your software isn't being maintained.
I don't see how a vital forum/cms project would be in a PHP-5.4 only situation.
* and then you cannot use binary binaries; you'd have to build from source and I don't know how pkg would view the "future" versions of everything you didn't rebuild and reinstall.