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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
5 + 16 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 10:01:29 2024 UTC