I just ran into the same problem this morning.
In an effort to be tidy and document my custom code, I added a line containing comments just before some custom PHP in my child-theme’s functions.php file. Once I put the comments inside of the PHP tags, the error went away.
Hope that helps everyone else too!