# PHP 4 to PHP 5 change - allowing assignment to pass by reference function parameters.

- Thread: https://externals.io/message/48990
- Original archive: https://news-web.php.net/php.internals/48990
- Started by Richard Quadling on 2010-07-01T10:21:39+00:00
- Messages: 3
- 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

---

## #48990 — Richard Quadling — 2010-07-01T10:21:39+00:00

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

Hi.

Is there any documentation regarding this change?

function ca_getUserDetails($pUserid, &$pResults=array()) {}

is fully allowable in PHP 5+, but not in PHP 4.

Depending upon version, the error is ...

Parse error:  parse error, expecting ')'

or

Parse error:  syntax error, unexpected '=', expecting ')'


I'm just looking for some notes to pass on.

Thank you.

Richard.


-- 
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

---

## #48991 — Peter Cowburn — 2010-07-01T10:31:25+00:00

URL: https://externals.io/message/48990#48991 · In reply to: #48990

> Hi.
>
> Is there any documentation regarding this change?

http://php.net/functions.arguments says "Note: As of PHP 5, default
values may be passed by reference."

>
> function ca_getUserDetails($pUserid, &$pResults=array()) {}
>
> is fully allowable in PHP 5+, but not in PHP 4.
>
> Depending upon version, the error is ...
>
> Parse error:  parse error, expecting ')'
>
> or
>
> Parse error:  syntax error, unexpected '=', expecting ')'
>
>
> I'm just looking for some notes to pass on.
>
> Thank you.
>
> Richard.
>
>
> --
> -----
> Richard Quadling
> "Standing on the shoulders of some very clever giants!"
> EE : http://www.experts-exchange.com/M_248814.html
> EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
> Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
> ZOPA : http://uk.zopa.com/member/RQuadling

---

## #48992 — Richard Quadling — 2010-07-01T10:37:20+00:00

URL: https://externals.io/message/48990#48992 · In reply to: #48991

> 
> > […]
>
> http://php.net/functions.arguments says "Note: As of PHP 5, default
> values may be passed by reference."
>
> > […]
>
Thank you.


-- 
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling
