|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #65614 misleading documentation in default values by reference
Submitted: 2013-09-04 10:29 UTC Modified: 2013-09-10 16:11 UTC
From: 4d95cb4a at opayq dot com Assigned: daverandom (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
38 - 6 = ?
Subscribe to this entry?

 [2013-09-04 10:29 UTC] 4d95cb4a at opayq dot com
misleading documentation in Note: As of PHP 5, default values may be 
passed by reference:

what it currently says:
Note: As of PHP 5, default values may be passed by reference.

what is should say:
Note: As of PHP 5, reference arguments may have default values.

Expected result:
the meaning of the documentation:

function bar(&$baz = 'baz') { }

Actual result:
from the current documentation you can understand:

function bar($baz = $foo) { } // syntax error

function bar($baz = &$foo) { } // syntax error


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-09-10 15:26 UTC]
Automatic comment from SVN on behalf of daverandom
Log: From doc bug 65614

This change makes the wording clearer for byref arguments being allowed a default value in the function signature.

Provided by anonymous #33404 (
 [2013-09-10 16:11 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: daverandom
 [2013-09-10 16:11 UTC]
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon May 29 19:03:42 2023 UTC