|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-05-06 13:01 UTC] uvealonso at gmail dot com
Description:
------------
Sometimes, the script stops 10 secs after the start, and others, it doesn't stop and complete the operations...
I have tested with the same data and parameters, and sometimes, it stops 10 secs after the script starts.
max_execution_time is 500000
Reproduce code:
---------------
print "start";
while ($a){
func_modify($a); //Here is a function that modifies $a
}
print "end";
Expected result:
----------------
start
end
Actual result:
--------------
sometimes:
"start"
or
"start
end"
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 05:00:01 2025 UTC |
Ok, I give you this 2 codes: First: ///////////////////////////////////////////// $tiempo1=microtime(true); print "START AT: ".$tiempo1."<br>"; //DO IT 15 SECONDS while((microtime(true)-$tiempo1)<15){ //PRINT EVERY STEP print "STEP: ".(microtime(true)-$tiempo1)."<br>"; } //IT MUST END 15 SECS AFTER THE START print "<br>END AT: ".(microtime(true)-$tiempo1); Second: ////////////////////////////////////////////////// $tm1=microtime(true); print "START AT: ".$tm1."<br>"; $t=0; //DO IT 15 SECONDS while((microtime(true)-$tm1)<15){ //PRINT STEPS OF 0.1 SECS if ((microtime(true)-$tm1)-$t>0.1){ print "STEP: ".(microtime(true)-$tm)."<br>"; $t=microtime(true)-$tm1; } } //IT MUST END 15 SECS AFTER THE START print "<br>END AT: ".(microtime(true)-$tm1); The 2 scripts must stop inmediately after 15 secs. The first works fine, but 2? stops after 10 seconds... You cant test it here: First example: http://www.4mula1.es/libraries/pruebas/timeout-test-1.php Second example: http://www.4mula1.es/libraries/pruebas/timeout-test-2.php PS: They have exactly the same code that I have wrote in this comment.