# ZEND_BEGIN_ARG_INFO

- Thread: https://externals.io/message/12984
- Original archive: https://news-web.php.net/php.internals/12984
- Started by Robert Silva on 2004-09-25T19:20:27+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

---

## #12984 — Robert Silva — 2004-09-25T19:20:27+00:00

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

When defining class methods that take object parameters using
ZEND_BEGIN_ARG_INFO and ZEND_ARG_OBJ_INFO, do you have to define it as
pass_by_ref or does the engine implictly know to pass them by ref.

Im assuming the pass_by_ref flag is more for backcompat reasons.

Thanks

Bob

---

## #13034 — Andi Gutmans — 2004-09-28T02:14:09+00:00

URL: https://externals.io/message/12984#13034 · In reply to: #12984

Actually objects should usually not be passed by reference. You want the 
handle to be passed by value (you will still me manipulating the original 
copy of the object). Only if you want to change the handle, i.e. object 
instance, do you want to pass by reference.

Andi

At 12:20 PM 9/25/2004 -0700, Robert Silva wrote:
>When defining class methods that take object parameters using
>ZEND_BEGIN_ARG_INFO and ZEND_ARG_OBJ_INFO, do you have to define it as
>pass_by_ref or does the engine implictly know to pass them by ref.
>
>Im assuming the pass_by_ref flag is more for backcompat reasons.
>
>Thanks
>
>Bob
