How does PHP max_execution_time work?
<p>I have few doubts about maximum execution time set in php.ini.</p>

<p>Assuming max_execution_time is 3 minutes, consider the following cases:</p>

<ol>
<li><p>I have a process which will end in 2 minutes.</p>

<p>But it's in a loop and it should work 5 times. So it become 10 minutes. </p>

<p>Will the script run properly with out showing error for time out? Why?</p></li>
<li><p>PHP function is just printing the data. it will take only 2 minutes.</p>

<p>But the query execution is taking 5 minutes.</p>

<p>Will the script run with out error? Why?</p></li>
<li><p>My single php process itself take 5 minutes.</p>

<p>But am calling script from command line.</p>

<p>Will it work properly? Why?</p></li>
<li><p>How are memory allowed and execution time related?</p>

<p>If execution time for a script is very high</p>

<p>But it returns small amount of data</p>

<p>Will it affect memory or not? Why?</p></li>
</ol>

<p>I want to learn what is happening internally, that is why am asking these.
I dont want to just increase time limit and memory limit.</p>
