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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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

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: Fri Mar 29 02:01:30 2024 UTC