You are here: if statement probable bug « PHP « IT news, forums, messages
if statement probable bug

Posted by TheI2eptile on 03/24/05 16:05

Probably this is the wrong place to put this but I couldn't search for
the bug and what I saw in the bugs newsgroup was a bit strange and seem
to be a log for the bugs forms.

So here is what I would call a bug, but maybe it's thought to be so:
<?php
$var1 = 0;
$var2 = "AS";

if($var1 == "AS"){
echo "<br>Why is this printed";
}

if(0 == "AS"){
echo "<br>At least this should not be printed";
}

if($var2 == "AS"){
echo "<br>Only this should";
}
?>
I didn't expect it. I use php 5.02 and have the zend debugger installed.
Does anybody see every echo and finds this strange in a typeless language?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация