PHP nested 'require_once' loop
<p>I have a file index.php which contains below code:</p>

<pre><code>&lt;?php
require_once('A.php');
// OTHER CODES ...
</code></pre>

<p>and A.php contains:</p>

<pre><code>&lt;?php
require_once('B.php');
// OTHER CODES ...
</code></pre>

<p>and B.php contains:</p>

<pre><code>&lt;?php
require_once('A.php');
// OTHER CODES ...
</code></pre>

<p>When I load index.php, my codes execute correctly and no error occurs.
Now my question is:
Is this algorithm correct? In other words how many times require_once can be nested. Will these 'require_once' can be repeate infinitely. Is there any other alternative method for this purpose?
Thanks.</p>