Why Exponential value is string?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
same2cool
Forum Newbie
Posts: 11
Joined: Tue Sep 24, 2013 5:05 am
Location: Lahore, Pakistan
Contact:

Why Exponential value is string?

Post by same2cool »

I used double codes. here. integer value is printing string type why?

Code: Select all

$name1 = "10e10";
var_dump($name1);
it will defiantly shows : 10e10 => String

but when I use :

Code: Select all

$name1 = 10e10;
var_dump($name1);
it also shows 10000000000 => String

how is this possible
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: Why Exponential value is string?

Post by AbraCadaver »

$name1 = 10e10;
var_dump($name1);


it also shows 10000000000 => String

how is this possible
No.
[text]float(100000000000)[/text]
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
same2cool
Forum Newbie
Posts: 11
Joined: Tue Sep 24, 2013 5:05 am
Location: Lahore, Pakistan
Contact:

Re: Why Exponential value is string?

Post by same2cool »

Yes you are right, I recheck this code,

my system cache was giving problem.
Post Reply