logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: [apc] apc_store crash on circle reference?: msg#00182

Subject: Re: [apc] apc_store crash on circle reference?
>
> 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? :)




Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>