Can I enforce function parameter typing?
Posted: Tue Jul 29, 2008 3:00 am
I have the following function:
and I am calling it like this:
PHP is interpreting the 1234567890... value as a double, meaning it displays as 1.2345678nnn+Exx when I convert it to a string. This is indeed the correct behaviour.
I want to convert the variable to a string and have PHP echo "1234567890123456789012345678901234567890", not scientific notation.
Oh, doSomething("1234567890...") with quotes is not an option, it has to be called without quotes if possible. You must be thinking: "Why in the hell is he trying to do that?"
Thanks for the help!
Code: Select all
<?php
function doSomething($withThis){
// Do something $withThis
// ... for example - convert it to a string and echo it
}
?>Code: Select all
<?php
doSomething(1234567890123456789012345678901234567890);
?>I want to convert the variable to a string and have PHP echo "1234567890123456789012345678901234567890", not scientific notation.
Oh, doSomething("1234567890...") with quotes is not an option, it has to be called without quotes if possible. You must be thinking: "Why in the hell is he trying to do that?"
Thanks for the help!