Req #53895 [Com]: debug_zval_dump should be by ref
| From: | + at ni-po dot com | Date: | Sat, 05 Feb 2011 10:47:52 +0000 |
| Subject: | Req #53895 [Com]: debug_zval_dump should be by ref | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-158508@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=53895&edit=1
ID: 53895
Comment by: + at ni-po dot com
Reported by: + at ni-po dot com
Summary: debug_zval_dump should be by ref
Status: Wont fix
Type: Feature/Change Request
Package: Variables related
PHP Version: 5.3.5
Block user comment: N
Private report: N
New Comment:
Hm, the problem seems to be more complicated when I thought. The only
thing I can think of, that would allow arrays and objects, too, is to
provide a function zval_is_ref that checks, whether the zval is_ref and
then provide two function, zval_dump_by_ref and zval_dump_by_val.
Imho this would cover all cases, but I assume that that's too many
functions.
Previous Comments:
------------------------------------------------------------------------
[2011-02-04 22:15:29] johannes@php.net
The string version won't help for all cases, as you can't adress array
elements or objects properly then. So there's no good way.
------------------------------------------------------------------------
[2011-02-01 15:13:07] + at ni-po dot com
That would obviously be even better. I just wanted to note, that
something must be changed about it.
------------------------------------------------------------------------
[2011-02-01 13:49:28] cataphract@php.net
I disagree. Receiving the variable by reference would solve nothing, as
it would force a separation on zvals with refcount > 1.
What actually ought to be done is make debug_zval_dump work like
xdebug's version and accepting a string.
------------------------------------------------------------------------
[2011-01-31 23:43:14] + at ni-po dot com
Description:
------------
debug_zval_dump should accept the variable by reference.
Currently one can call the function either via debug_zval_dump($var) or
debug_zval_dump(&$var). As the latter is as deprecated as it gets (i.e.
parse-time deprecated) and is even removed in trunk, the function should
be defined as accepting the variable by reference, because this is the
usual use case.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53895&edit=1