php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22994 if ( $something == "NAME") { print $something } prints "0"
Submitted: 2003-03-31 16:45 UTC Modified: 2003-03-31 17:02 UTC
From: hermandepauw at hotmail dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.3.0 OS: Red Hat Linux
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: hermandepauw at hotmail dot com
New email:
PHP Version: OS:

 

 [2003-03-31 16:45 UTC] hermandepauw at hotmail dot com
if ( $something == "NAME") { print $something } prints "0"

the main problem is in the summary ... example code and source on http://www.deparadox.be/php/ i don't know the explain it in words so get a view ... code is only ~10 lines 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-31 17:02 UTC] rasmus@php.net
Use === if you want to check both type and value.  The numerical value of "NAME" is indeed 0, so if $something is 0 the condition will be true.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Dec 17 19:00:02 2025 UTC