# reference issue

- Thread: https://externals.io/message/15473
- Original archive: https://news-web.php.net/php.internals/15473
- Started by Lukas Smith on 2005-03-17T12:04:20+00:00
- Messages: 5
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #15473 — Lukas Smith — 2005-03-17T12:04:20+00:00

URL: https://externals.io/message/15473#15473

Hi,

I have encountered yet another reference issue. I tested this on PHP 
4.3.10 and 4.3.11RC1 on both windows and linux.

Here is a script that reproduces the issue:
http://www.backendmedia.com/PHP/reference_bug.phps

In the comments at the top you can also see my "hack" which fixes the 
problem for me.

I have also tried Derick's patch on the 4.3.11RC1 install on linux, but 
this didnt change the situation at all.

regards,
Lukas

---

## #15474 — Moriyoshi Koizumi — 2005-03-17T12:25:10+00:00

URL: https://externals.io/message/15473#15474 · In reply to: #15473

That's expected behaviour. Have a look at http://bugs.php.net/20993 .

The problem can also be prevented by the following hack:

// modifying and assining branch causes unexpexted results to 
$this->tree
$metatree[$object_id] = (array)unserialize(serialize($branch));

Regards,
Moriyoshi




> Hi,
>
> I have encountered yet another reference issue. I tested this on PHP 
> 4.3.10 and 4.3.11RC1 on both windows and linux.
>
> Here is a script that reproduces the issue:
> http://www.backendmedia.com/PHP/reference_bug.phps
>
> In the comments at the top you can also see my "hack" which fixes the 
> problem for me.
>
> I have also tried Derick's patch on the 4.3.11RC1 install on linux, 
> but this didnt change the situation at all.
>
> regards,
> Lukas

---

## #15475 — Derick Rethans — 2005-03-17T12:36:33+00:00

URL: https://externals.io/message/15473#15475 · In reply to: #15474

> That's expected behaviour. Have a look at http://bugs.php.net/20993 .

Sorry, but this is not expected - it's a bug.

Derick

-- 
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org

---

## #15477 — Lukas Smith — 2005-03-17T12:52:30+00:00

URL: https://externals.io/message/15473#15477 · In reply to: #15475

Derick Rethans wrote:
> 
> 
> > […]
> 
> 
> Sorry, but this is not expected - it's a bug.

I would also like to disagree. I think this is a huge inconsistency that 
should be addressed even if that costs performance.

If however the core php developers do think this behavior should stick, 
then there should be a function that allows people to clean these 
references without such hacks (even if internally these hacks are still 
going on).

regards,
Lukas

---

## #15478 — Moriyoshi Koizumi — 2005-03-17T18:36:00+00:00

URL: https://externals.io/message/15473#15478 · In reply to: #15477

> Derick Rethans wrote:
> > […]
>
> I would also like to disagree. I think this is a huge inconsistency 
> that should be addressed even if that costs performance.

I agree that it's not intuitive at all, though this issue was discussed
ending up with the following words.

http://marc.theaimsgroup.com/?l=php-dev&m=104018832405963&w=2

> If however the core php developers do think this behavior should 
> stick, then there should be a function that allows people to clean 
> these references without such hacks (even if internally these hacks 
> are still going on).

I think it's possible to add such a function to the 5.x branches.

Moriyoshi
