# simple feature request :]

- Thread: https://externals.io/message/8357
- Original archive: https://news-web.php.net/php.internals/8357
- Started by Robert Janeczek on 2004-03-03T21:08:21+00:00
- Messages: 4
- 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

---

## #8357 — Robert Janeczek — 2004-03-03T21:08:21+00:00

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

i was wondering if there would be much trouble with adding boolean trigger
to
get_class_vars ( string class_name) and
get_object_vars ( object obj)
which will tell this functions whether to return array with names and values
or with names only. with default option set to returning names and values
there will be no bc broken.

or maybe there is somewhere a function that lists class/object variables
names?

rash

---

## #8362 — Sara Golemon — 2004-03-03T23:34:44+00:00

URL: https://externals.io/message/8357#8362 · In reply to: #8357

> i was wondering if there would be much trouble with adding boolean trigger
> to
> get_class_vars ( string class_name) and
> get_object_vars ( object obj)
> which will tell this functions whether to return array with names and
values
> or with names only. with default option set to returning names and values
> there will be no bc broken.
>
> or maybe there is somewhere a function that lists class/object variables
> names?
>
Something like array_keys(get_class_vars($classname)) or
array_keys(get_object_vars($object))  ?

---

## #8367 — Robert Janeczek — 2004-03-04T11:22:48+00:00

URL: https://externals.io/message/8357#8367 · In reply to: #8362

> Something like array_keys(get_class_vars($classname)) or
> array_keys(get_object_vars($object))  ?

:) sure, but what i want to get is reading variable names without copying
values. let`s say i have object with 2MB of text in it - using
get_class[object]_vars would copy whole text to temporary array, wouldn`t
it? or is there only reference operation inside? if reference only than i
cancel my question :) but if threre is copying  - my question remains - how
do i get class variables names without reading their values?

rash

---

## #8368 — Derick Rethans — 2004-03-04T11:29:14+00:00

URL: https://externals.io/message/8357#8368 · In reply to: #8367

> > […]
>
> :) sure, but what i want to get is reading variable names without copying
> values. let`s say i have object with 2MB of text in it - using
> get_class[object]_vars would copy whole text to temporary array, wouldn`t
> it?

No, it won't copy it, unless you modify elements in the returned array
or the returned array itself. (And in the latter case only the array
structure is copied, not the elements).

regards,
Derick
