php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37750 If else statement got bugs
Submitted: 2006-06-08 18:07 UTC Modified: 2006-06-08 18:15 UTC
From: xenophobia_1987 at yahoo dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.4.2 OS: Debian GNU/Linux
Private report: No CVE-ID: None
 [2006-06-08 18:07 UTC] xenophobia_1987 at yahoo dot com
Description:
------------
Problem occured while I'am using the if-else statment...

Is hard to explain... lets look at the code...

Reproduce code:
---------------
//declaring variable
$var1 = "words";

if($var1 == 0){
   echo "Is a zero";
}else if($var1 == "words"){
   echo "Is a string";
}

Expected result:
----------------
Is a string

Actual result:
--------------
Is a zero

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-08 18:15 UTC] tony2001@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Use ===.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Mon May 18 15:00:01 2026 UTC