php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #521 Variable Number Function Args
Submitted: 1998-07-08 14:20 UTC Modified: 1998-07-10 07:23 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: jwalsh at verio dot net Assigned:
Status: Closed Package: Parser error
PHP Version: 3.0 Final Release OS: Solaris 2.5x
Private report: No CVE-ID: None
 [1998-07-08 14:20 UTC] jwalsh at verio dot net
$FONT_OPEN = "<font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\">";
$FONT_CLOSE = "</font>";

function print_text ($print_text, $fo=$FONT_OPEN, $fc=$FONT_CLOSE) {
	printf( "%s%s%s\n", $fo, $print_text, $fc );
	return 1;
}

gives a parse error at the function declaration.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-07-10 07:23 UTC] zeev
As the documentation says (or at least I think it does, perhaps it's not yet documented), *only* scalar values are supported
as argument defaults.  That includes strings, numbers and constants - nothing else is supported (including variables).

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 08:01:27 2024 UTC