Thanks so much for the quick fix! 🙂
Sorry, I didn’t get to reply earlier, but my config is:
WP: 5.2.2
ACF: 5.7.13
PHP: 7.2.8
This is my local dev install, using MAMP 5.1.
The only thing I could find is that it looks like I was getting a segmentation error in PHP at this time in my Apache error logs, along the lines of:
child pid XXXXX exit signal Segmentation fault (11)
Looks like this is related to the issue, since I just went back in and reintroduced the old code to test and got this same error again. Not sure if there is maybe a module or extension in my PHP which is conflicting, or something in the WP theme/setup that’s interfering with the WP compatibility function – definitely seems to be something specific to my config either way.