#38351 [Fbk->Bgs]: Incorrect hex value

From: Date: Mon, 07 Aug 2006 20:55:39 +0000
Subject: #38351 [Fbk->Bgs]: Incorrect hex value
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-100478@lists.php.net to get a copy of this message
ID: 38351 Updated by: derick@php.net Reported By: kevin at oceania dot net -Status: Feedback +Status: Bogus Bug Type: Filter related Operating System: Linux PHP Version: 5.2.0RC1 New Comment: Numbers starting with 0 only are octal numbers. Previous Comments: ------------------------------------------------------------------------ [2006-08-07 18:08:07] pajoye@php.net I'm not sure about this problem. Allowing octal formats brings some problems. What is the normal octal format? 1666, is it the decimal 1666? or octal 1666 (950 in decimal). There is no standard like 0x1234 for the hexadecimal format. If we define that an octal number must start with 0 (zero), it will then be easier. Not sure what is the less confusing solution :) Also in your example, it should 438 not 666, if you expect an octal number. Any other opinion? ------------------------------------------------------------------------ [2006-08-07 16:13:09] iliaa@php.net Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.2-win32-latest.zip Seems to work in latest CVS. ------------------------------------------------------------------------ [2006-08-05 21:38:25] kevin at oceania dot net Description: ------------ In correct return value for OCTAL representations Also the ext/filter/tests/013.phpt file has an EXPECT of int(438) for this test. Reproduce code: --------------- var_dump(filter_data("0666", FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL))); Expected result: ---------------- int(666) Actual result: -------------- bool(false) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38351&edit=1

« previous php.bugs (#100478) next »