#47914 [Bgs]: Integer begining by 0
| From: | pserin at afone dot com | Date: | Tue, 07 Apr 2009 09:34:56 +0000 |
| Subject: | #47914 [Bgs]: Integer begining by 0 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-135625@lists.php.net to get a copy of this message | ||
ID: 47914
User updated by: pserin at afone dot com
Reported By: pserin at afone dot com
Status: Bogus
Bug Type: Variables related
Operating System: Windows / Linux
PHP Version: 5.2.9
New Comment:
So what can I do when I have to set a phone number (begining with 0033)
and I can't do anything to cast it to a string ?
Previous Comments:
------------------------------------------------------------------------
[2009-04-07 09:08:36] jani@php.net
Number beginning with 0 is not an integer, it's an octal number. This
is not a bug.
------------------------------------------------------------------------
[2009-04-07 07:41:18] pserin at afone dot com
Description:
------------
Any integer begining by 0 is truncated or display wierdly. The only way
to get around it is to put the number between commas.
Reproduce code:
---------------
<?php
$number = 0058434648616;
$multipl = 2;
$result = $number * $multipl;
echo $number." x ".$multipl." = ".$result;
?>
Expected result:
----------------
58434648616 x 2 = 116869297232
Actual result:
--------------
5 x 2 = 10
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47914&edit=1