#23195 [Ana->Ver]: Use of $_POST/$_SESSION causes a endless loop

From: Date: Wed, 23 Apr 2003 08:25:20 +0000
Subject: #23195 [Ana->Ver]: Use of $_POST/$_SESSION causes a endless loop
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-38150@lists.php.net to get a copy of this message
ID: 23195 Updated by: sniper@php.net Reported By: jc at mega-bucks dot co dot jp -Status: Analyzed +Status: Verified -Bug Type: Reproducible crash +Bug Type: Scripting Engine problem Operating System: Red Hat Linux 8.0 PHP Version: 4.3.2RC1 Previous Comments: ------------------------------------------------------------------------ [2003-04-18 21:19:43] iliaa@php.net Here is a shorter example that demonstrates the problem: <?php $arr = array('a', 'b'); while (each($arr)) $arr2 = $arr; ?> ------------------------------------------------------------------------ [2003-04-14 01:15:09] jc at mega-bucks dot co dot jp The following piece of code never terminates: <?php while (list($k, $v) = each( $_POST )) { if(strstr($k, "CHANGE_DEL_DATES")) { session_set_post_vars( $_POST ); } } function session_set_post_vars($post) { $_SESSION["S_POST_VALUES"] = $post; } ?> The contents of the $_POST superglobal were: Array ( [CURRENT_DEL_METHOD] => YAMATO [DEL_YEAR1] => 2003 [DEL_MONTH1] => 04 [DEL_DAY1] => 12 [ptime1] => 1 [DEL_YEAR2] => 2003 [DEL_MONTH2] => 04 [DEL_DAY2] => 12 [DEL_YEAR3] => 2003 [DEL_MONTH3] => 04 [DEL_DAY3] => 12 [DELIVER_ANYDAY] => on [CHANGE_DEL_DATES_x] => 14 [CHANGE_DEL_DATES_y] => 7 ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23195&edit=1

« previous php.bugs (#38150) next »