# Checking whether parameter is passed by ref

- Thread: https://externals.io/message/12172
- Original archive: https://news-web.php.net/php.internals/12172
- Started by Andrey Hristov on 2004-08-15T17:06:59+00:00
- Messages: 1
- 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

---

## #12172 — Andrey Hristov — 2004-08-15T17:06:59+00:00

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

Hello,
the topic clearly states what I would like to achieve. I know that parameter
can be forced to be passed by reference when declared but in my case
this is not an option (still). I would like to determine this at run time
based on some other conditions I have to check whether the param
is a reference or not (whether variable was passed or value (like "foo")).

I have found some documentation and examples that use
ParameterPassedByReference() function of ZE1. However Zeev
has removed it from the engine at Jul 30, 2001 (commit msg :
"More TSRMLS_FETCH work, and get rid of redundant ParametersPassedByRef").
I have tried with PZVAL_IS_REF(*str)  (zval **str), but no success - (*str)->is_ref is 0.
The old parameters parsing API is used : zend_get_parameters_ex()
I even tried to copy the removed function and it still does not give me the wanted result
<?php
	$a = "foobar";
	my_func("foobar");
	my_func($a);
?>
In brief I want the the example to find out that the second call used a variable.

Thanks in advance,
Andrey
