White Screen of death after upgrade

I recently upgraded from openemr 4.2.0 to openemr 5.0.0 and I get a white screen when I try to view an old patient visit. I checked the php log and its says,

[06-Apr-2018 21:17:14 Asia/Colombo] PHP Fatal error:  Cannot use result of built-in function in write context in /Applications/MAMP/htdocs/openemr5/library/classes/Tree.class.php on line 329

Any idea how to fix this?

Fixed this by switching the PHP Version to 5.6.

How did you switch?
I’ve tried:

sudo a2dismod php57.2
sudo a2enmod php75.6
sudo service apache2 restart

But when I restart I can’t access the emr and “php -v” still says I’m on 7.2