note 28315 deleted from functions.arguments by jmcastagnetto
| From: | jmcastagnetto@php.net | Date: | Thu, 09 Jan 2003 23:54:40 +0000 |
| Subject: | note 28315 deleted from functions.arguments by jmcastagnetto | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-41932@lists.php.net to get a copy of this message | ||
[Editor's note: This code as written does not produce the expected output, because the author
makes the assumption that number representations are considered strings, and thus should be shown in
the concatenated output as passed, which is not correct. If you really need formatted strings, use
strings not numbers or use sprintf(), printf(), or similar function.]
function a($x, $y)
{
print($x . ' ' . $y);
}
a(2.0, 2.1);
produces
2 2.1
instead of
2.0 2.1
I tried getting the arguements with get_func_arg() and type casting and a few other things but all
produced 2 instead of 2.0. When you need 2.0 as 2.0, you have to specify
a('2.0', 2.1);