I thought, but not certain as I don’t use MAMP Pro anymore that it was a setting you could choose to switch on, just like you can switch between different PHP versions.
I too am seeing this problem when I have an object cache turned on. @spaced_monkey’s code suggestion removes the issue.
Any word on whether / when a fix for this will be sorted please?