# Bug fix for #28817 - different behaviour in HEAD and 5_0

- Thread: https://externals.io/message/13996
- Original archive: https://news-web.php.net/php.internals/13996
- Started by Georg Richter on 2004-12-03T16:14:34+00:00
- Messages: 2
- 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

---

## #13996 — Georg Richter — 2004-12-03T16:14:34+00:00

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

Hi,

the following patch solves bug #28817 in HEAD.
However it doesn't work in 5_0 branch. In 5_0 I have to set
retval->refcount to 1 to get it work - any ideas what's going wrong ?!

Same behaviour in mysqli (which has a similiar property handling).

/Georg

Patch:

diff -u -r1.64 php_dom.c
--- php_dom.c   7 Oct 2004 11:40:20 -0000       1.64
+++ php_dom.c   3 Dec 2004 13:49:25 -0000
@@ -235,6 +235,7 @@
        } else {
                std_hnd = zend_get_std_object_handlers();
                retval = std_hnd->read_property(object, member, type
TSRMLS_CC);
+               retval->refcount = 0;
        }

        if (member == &tmp_member) {

---

## #14015 — Andi Gutmans — 2004-12-08T00:37:17+00:00

URL: https://externals.io/message/13996#14015 · In reply to: #13996

Hi Georg,

When we nuked the garbage collector this behavior was accidentally changed. 
I think it should be fixed in the Zend Engine so that extensions stay 
source compatible in between versions as much as possible.
Will look into it.

Thanks,

Andi

At 05:14 PM 12/3/2004 +0100, Georg Richter wrote:
>Hi,
>
>the following patch solves bug #28817 in HEAD.
>However it doesn't work in 5_0 branch. In 5_0 I have to set
>retval->refcount to 1 to get it work - any ideas what's going wrong ?!
>
>Same behaviour in mysqli (which has a similiar property handling).
>
>/Georg
>
>Patch:
>
>diff -u -r1.64 php_dom.c
>--- php_dom.c   7 Oct 2004 11:40:20 -0000       1.64
>+++ php_dom.c   3 Dec 2004 13:49:25 -0000
>@@ -235,6 +235,7 @@
>         } else {
>                 std_hnd = zend_get_std_object_handlers();
>                 retval = std_hnd->read_property(object, member, type
>TSRMLS_CC);
>+               retval->refcount = 0;
>         }
>
>         if (member == &tmp_member) {
