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
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:
MUST BE VALID
Solve the problem:
36 + 26 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 00:01:28 2024 UTC