note 15547 deleted from function.bindec by danielc
| From: | danielc@php.net | Date: | Tue, 14 Apr 2009 23:27:50 +0000 |
| Subject: | note 15547 deleted from function.bindec by danielc | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-153225@lists.php.net to get a copy of this message | ||
Note Submitter: da_he4datthe-gurusdotde
Reason: 0
----
[Editor's Note:
Numeric values starting with 0 are interpreted as octal (base eight) values. For example: 0101 is
converts to 65
--zak@php.net]
i was quite confused while werking with those bindec()/decbin() functions..
while
echo decbin(bindec(1));
echo decbin(bindec(10));
echo decbin(bindec(101));
just worked like expected,
echo decbin(bindec(010));
returns just 0
and for any reason
echo decbin(bindec(010010010));
returns 101000
i dont think this is a bug (maybe theres some special reason 4 this?), but it took a certain time
till i noticed that
echo decbin(bindec("010010010"));
works fine ...
hope this helps ne1.