|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14054 Error evaluating the Intval function
Submitted: 2001-11-14 11:24 UTC Modified: 2001-11-15 04:25 UTC
From: shiva at paraffa dot org Assigned:
Status: Not a bug Package: *Regular Expressions
PHP Version: 4.0.4pl1 OS: Windows 2000 Server
Private report: No CVE-ID: None
 [2001-11-14 11:24 UTC] shiva at paraffa dot org

See this simple script
if (intval($val) == $val)
   echo "$val is equal to".intval($val);
   echo "$val is not equal to".intval($val);

If i put a string in $val...for example "ABC" ad i run the script...PHP print:"ABC is equal to 0"

Thanks for all your work that give me a work ^_^'


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-14 12:02 UTC]
This is not a bug, please ask support questions on the mailinglist.

 [2001-11-15 04:23 UTC]
try (int)$val or use sprintf() or any other function to format you integer. Btw. (int)$string returns 0

 [2001-11-15 04:25 UTC]
Non-Bugs have status 'Bogus'
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 18:01:28 2024 UTC