php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #38351 Incorrect hex value
Submitted: 2006-08-05 21:38 UTC Modified: 2006-08-31 16:14 UTC
From: kevin at oceania dot net Assigned: pajoye (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.2.0RC1 OS: Linux
Private report: No CVE-ID: None
 [2006-08-05 21:38 UTC] 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)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-07 16:13 UTC] 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-07 18:08 UTC] 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 20:55 UTC] derick@php.net
Numbers starting with 0 only are octal numbers.
 [2006-08-07 21:57 UTC] pajoye@php.net
It is a documentation problem then. I will update the doc. I will close the bug once it is updated.
 [2006-08-31 16:14 UTC] pajoye@php.net
Fixed by Philip.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 14:04:04 2025 UTC