php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #15095 use of references in arguments with defaults
Submitted: 2002-01-18 03:48 UTC Modified: 2011-01-01 00:11 UTC
From: gusito at cwadv dot com Assigned:
Status: Wont fix Package: Scripting Engine problem
PHP Version: 4.1.1 OS: linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: gusito at cwadv dot com
New email:
PHP Version: OS:

 

 [2002-01-18 03:48 UTC] gusito at cwadv dot com
I would like to be able to define a function with a 
referenced argument as well as give it a default value.

function foo(&$bar = NULL) {}

So, what will it reference, you ask? Nothing. I just want 
the argument to be optional, but to reference if there is 
an argument supplied. So, it's less of a default that's 
needed for references, more the ability to have the 
argument be optional.

This would make me so happy.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-01 00:11 UTC] jani@php.net
-Status: Open +Status: Wont fix -Package: Feature/Change Request +Package: Scripting Engine problem
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 15:01:27 2025 UTC