Date: 10/31/00
- Next message: Michael Youngstrom: "RE: [PHP-DEV] PHP 4.0 Bug #6529 Updated: Problems with $this in class constructor"
- Previous message: mathieu <email protected>: "[PHP-DEV] PHP 4.0 Bug #6529 Updated: Problems with $this in class constructor"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: twoerner <email protected>
Operating system: RedHat 7
PHP version: 4.0.3pl1
PHP Bug Type: *Session related
Bug description: Array stored in session loose content
<?
class C_CART_ITEM {
var $pid;
var $id=0;
Function C_CART_ITEM() { }
}
class C_SESSION {
var $cart1 = array();
var $cart2 = array();
Function C_SESSION() { }
Function update() {
$item = new C_CART_ITEM();
$item->pid = "".time();
array_push($this->cart1, $item);
array_push($this->cart2, $item);
}
Function show() {
echo("ITEMS:<BR><TABLE CELLSPACING=2 CELLPADDING=0>");
$i = 0;
while ($i < MAX(count($this->cart1),count($this->cart2))) {
$item = &$this->cart1[$i];
$item->id += 1;
echo("<TR><TD>".$item->pid." : ".$item->id."</TD>");
$item = &$this->cart2;
$item[$i]->id += 1;
echo("<TD>".$item[$i]->pid." : ".$item[$i]->id."</TD</TR>");
$i++;
}
echo("</TABLE><P>");
}
}
session_start();
if (!$session) {
$session = new C_SESSION();
session_register("session");
} else
$session->update();
echo "SESSION-ID: ".session_id()."<BR>";
$session->show();
?>
-- Edit Bug report at: http://bugs.php.net/?id=7557&edit=1-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Michael Youngstrom: "RE: [PHP-DEV] PHP 4.0 Bug #6529 Updated: Problems with $this in class constructor"
- Previous message: mathieu <email protected>: "[PHP-DEV] PHP 4.0 Bug #6529 Updated: Problems with $this in class constructor"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

