Re: [apc] apc_store crash on circle reference?

From: Date: Thu, 29 Sep 2005 17:05:00 +0000
Subject: Re: [apc] apc_store crash on circle reference?
References: 1 2  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-3023@lists.php.net to get a copy of this message
> > gah! Don't do that. But yes, I guess a reference loop check could be > added. Feel free to send a patch. > > -Rasmus > thanks for you confirmation. i'll try to avoid it as a temporary solution. =========== <?php $a = array(); $b = array(); $a['b1'] = &$b; $a['b2'] = &$b; echo "<pre>"; apc_store('a', $a); $c = apc_fetch('a'); $a['b1'][] = 1; $c['b1'][] = 1; var_dump($a); var_dump($c); ?> $a $c result in different dump so it's not only a circle problem, but also a reference problem. but i'd wish both the circle and reference to be supported it's sometimes useful: $groups = array(array('name' => 'genius', 'users' => array())); $users = array(array('name' => 'Rasmus', 'group' = &$group1)); $groups[0]['users'][] = &$users[0]; $smarty->assignByRef('groups', $groups); $smarty->assignByRef('users', $users); i dunno if the html designer is going to 1. foreach ($groups as $group) { foreach ($group.users as $user) { ... } } or 2. foreach ($users as $user) { then echo $user['name'] and $user['group']['name'] } anyone else going to patch it if Rasmus doesn't? :)

« previous php.pecl.dev (#3023) next »