php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38407 If statement acts weird
Submitted: 2006-08-10 09:22 UTC Modified: 2006-08-10 09:33 UTC
From: pear dot 20 dot fab at spamgourmet dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.1.4 OS: FC5
Private report: No CVE-ID: None
 [2006-08-10 09:22 UTC] pear dot 20 dot fab at spamgourmet dot com
Description:
------------
The IF statement acts weird ... just have a look.

Reproduce code:
---------------
<?php

if(0 == 'std') {
    echo "are you kidding?";
}
else{
    echo "alright";
}

?>

Expected result:
----------------
alright

Actual result:
--------------
are you kidding?

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-10 09:28 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

var_dump(0 == 'string');
var_dump(0 === 'string');
 [2006-08-10 09:33 UTC] pear dot 20 dot fab at spamgourmet dot com
It's not a bug - it's a feature! O_o
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 14 21:01:33 2025 UTC