I faced a strange issue with WordPress. When I put this line as a code snippet in a blog post:
$app = require_once __DIR__.'/../bootstrap/app.php';
I get a 404 error when I try to preview the page, and I wont be able to save the post at all but if I make the line of code incorrect for example, remove the last ‘e’ from require, this way:
$app = requir_once __DIR__.'/../bootstrap/app.php';
everything works fine. Is the code somehow executing and causing problems?
Read more here: PHP code snippet causes page 404 in WordPress