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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: shiva at paraffa dot org
New email:
PHP Version: OS:

 

 [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

Pull Requests

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 Dec 12 18:01:26 2024 UTC