#38888 [Opn->Fbk]: gmp_init treats leading zero as octal

From: Date: Wed, 20 Sep 2006 06:44:15 +0000
Subject: #38888 [Opn->Fbk]: gmp_init treats leading zero as octal
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969374055@lists.php.net to get a copy of this message
ID: 38888 Updated by: bjori@php.net Reported By: php at richardneill dot org -Status: Open +Status: Feedback Bug Type: Documentation problem PHP Version: Irrelevant New Comment: What exactly gave you the impression it $i = 010; should be 10? IMO it is very well documented at php.net/integer and has nothing to do GMP what so ever. (I don't see your note anywhere..) Previous Comments: ------------------------------------------------------------------------ [2006-09-19 23:57:22] php at richardneill dot org Description: ------------ The documentation for gmp_init implies that a number will only be parsed as hexadecimal if it begins with 0x, and decimal otherwise. Thus: "10" means ten "0x10" means sixteen "010" means ten. However, in practice, "010" is parsed as eight!. Not sure whether this is a documentation bug, or an actual bug though. Personally, I'd prefer "010" to mean ten, but I am aware of some conventions in which it means octal. Confusingly: $x=010 //$x is eight $x="010" //$x is ten Please also correct the comment I added to the gmp_init page - I said that it 010 was parsed as hex, when I meant octal. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38888&edit=1

« previous php.doc (#969374055) next »