php.net |  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
Hi,

See this simple script
<?
if (intval($val) == $val)
   echo "$val is equal to".intval($val);
else
   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 ^_^'

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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

Derick
 [2001-11-15 04:23 UTC] bate@php.net
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] derick@php.net
Non-Bugs have status 'Bogus'
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Apr 21 12:01:25 2019 UTC