You do not need to make a forward declaration in PHP, instead you need to declare a function in the current script (even if it is after a call) or in any included / required script, the include / require statement is executed before the function is called.
No forward declaration.
If on the current script, even at the end, after the call: it 'ok
If it is on an INCLUDEd / REQUIREd script using the current script, the INCLUDE / REQUIRE statement should have been executed BEFORE the function call.
If it is on a script, INCLUDE / REQUIRE the current script: it is normal (even if declared AFTER the INCLUDE / REQUIRE statement)
source share