4 ms·
3) 4) <?php echo foo('baz'); function foo($bar) { return $bar; } ?> This looks to me like you can use PHP functions before declaring them above.
by codexon 17y ago
3) 4)
<?php
echo foo('baz');
function foo($bar) {
return $bar;
}
?>
This looks to me like you can use PHP functions before declaring them above.
- pbiggar 17y agoFunctions and classes declared anywhere in a file are pushed to the top of that file by the parser. This obscures all the edge cases. Simplest example I can think of: echo foo('baz'); // error { function foo($bar) { return $bar; } // not pulled to top of file }