# PHP Extensions & Pass-By-Reference

- Thread: https://externals.io/message/15184
- Original archive: https://news-web.php.net/php.internals/15184
- Started by Chris Cranford on 2005-02-25T01:22:39+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

---

## #15184 — Chris Cranford — 2005-02-25T01:22:39+00:00

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

I have a PHP_FUNCTION() defined in my PHP extension.  How am I suppose to
pass variables by reference to my function without enabling call-time pass
by reference in the PHP.INI file?

Thanks

---

## #15189 — Marcus Boerger — 2005-02-25T19:09:00+00:00

URL: https://externals.io/message/15184#15189 · In reply to: #15184

Hello Chris,

  you need to define that signature of your functions by supplying
ZEND_ARG_INFO's to them. look at ZEND_API.h file for those macros.

marcus

Friday, February 25, 2005, 2:22:39 AM, you wrote:

> I have a PHP_FUNCTION() defined in my PHP extension.  How am I suppose to
> pass variables by reference to my function without enabling call-time pass
> by reference in the PHP.INI file?

> Thanks




-- 
Best regards,
 Marcus                            mailto:helly@php.net

---

## #15191 — Brad House — 2005-02-25T19:28:06+00:00

URL: https://externals.io/message/15184#15191 · In reply to: #15184

look at
http://cvs.php.net/co.php/php-src/ext/mcve/mcve.c?r=1.28.2.2

the m_completeauthorizations  function.

-Brad

Chris Cranford wrote:
> I have a PHP_FUNCTION() defined in my PHP extension.  How am I suppose to
> pass variables by reference to my function without enabling call-time pass
> by reference in the PHP.INI file?
> 
> Thanks

---

## #15195 — Richard Lynch — 2005-02-25T20:50:02+00:00

URL: https://externals.io/message/15184#15195 · In reply to: #15184

Chris Cranford wrote:
> I have a PHP_FUNCTION() defined in my PHP extension.  How am I suppose to
> pass variables by reference to my function without enabling call-time pass
> by reference in the PHP.INI file?

I think the definition in the C syntax of PHP_FUNCTION will do that for you.

You'll probably need to use some ZEND_xxx macro.

Check out simple functions (error_log springs to mind) that use pass by
reference.

-- 
Like Music?
http://l-i-e.com/artists.htm
