php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #32294 Intval doc doesn't mention return value
Submitted: 2005-03-13 23:01 UTC Modified: 2005-03-28 11:09 UTC
From: mpr at er dot dtu dot dk Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
 [2005-03-13 23:01 UTC] mpr at er dot dtu dot dk
Description:
------------
Intval documentation doesn't mention what the return value of intval applied to a non-nummeric string will be. Ie. Doesn't mention that

intval("this is not a number, and can never be interpreted as one"); 

will return -1.

Furthermore there's quite a few user contributed notes, that deal with intvals return value being undefined in case of integer overflow. This, IMHO, should be documented too.


Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-13 23:26 UTC] mpr at er dot dtu dot dk
Ooops, "will return -1" should read "will return 0"
 [2005-03-28 11:09 UTC] philip@php.net
These docs have been rewritten and will show up when the manual is next built. Thanks for the report! Here's the diff:
* http://cvs.php.net/diff.php/phpdoc/en/reference/var/functions/intval.xml?r1=1.3&r2=1.4

User notes and various return value information (including integer overflow) was added.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Aug 16 15:01:28 2024 UTC