I've tried a few different ways and per Is it possible to use php functions inside heredoc? it seems like the first one (for the GET) should work?
But it doesn't. Any way to do this simply, or should I just manually include the debug section?
function bottom_module() {
$print_r = print_r;
$html = <<<"OUTPUT"
<footer>
...
</footer>
<aside id="debug">
<hr>
<h3>Debug Area</h3>
<pre>
GET Contains:
{$print_r($_GET)}
POST Contains:
$print_r($_POST)
SESSION Contains:
print_r($_SESSION)
</pre>
</aside>
</body>
</html>
OUTPUT;
echo $html;
}
$print_r = print_r;refers to a constant calledprint_r. What you almost certainly intended to write was$print_r = 'print_r';- that is, set$print_rto be a string with the content'print_r'. In old versions of PHP, an odd feature guessed that undefined constants were intended to be strings, but it always issued a Notice or Warning while doing so, and the feature was removed in PHP 8.0 so it is an error instead.