PHP Function Call Placement
<p>Sorry if this is perceived to be a silly question, but I have the following 2 blocks of <strong>"sample"</strong> code contained in an include file (<em>just focus on the order of the lines of code and not the code itself</em>):</p>

<p>SAMPLE A</p>

<pre><code>function helloWorld() {
return 'hello world';
}

echo helloWorld();
</code></pre>

<p>SAMPLE B</p>

<pre><code>echo helloWorld();

function helloWorld() {
return 'hello world';
}
</code></pre>

<p>When I run the script, they both produce the same results. That's great.</p>

<p>But my question is (and I could not find a good answer or reference in any of my searches), is it okay to call the function before it is defined (ie, from a sequential parsing of the script file perspective)?</p>

<p>I don't want to run into any issues or deprecation down the road if I leave the function call ahead of the function definition block in my script file.</p>

<p>Thanks for taking a moment to comment on this minor question.</p>
