php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #10310 feature request
Submitted: 2001-04-12 15:29 UTC Modified: 2004-04-13 16:17 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: fabiankessler at usa dot net Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.0.4 OS: all
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: fabiankessler at usa dot net
New email:
PHP Version: OS:

 

 [2001-04-12 15:29 UTC] fabiankessler at usa dot net
function foo($a, $b, $c='hello', $d='world') {
  echo $c;
}

i'd like to use
foo('a', 'b', NULL, 'c');
or even better
foo('a', 'b', , 'c');
to have it echo 'hello', the default value.

i have to workaround using 
function foo($a, $b, $c='hello', $d='world') {
  if (is_null($c)) $c = 'hello';
  echo $c;
}

is there a better way? i really miss this vb-feature.

greetings
fab

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-13 16:17 UTC] sniper@php.net
wont happen. (PHP != VB)

 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Jan 29 01:03:36 2022 UTC