PHP 4.0 Bug #6738: If statement not liking 0

From: Date: Wed, 13 Sep 2000 20:32:42 +0000
Subject: PHP 4.0 Bug #6738: If statement not liking 0
Groups: php.dev 
Request: Send a blank email to php-dev+get-33224@lists.php.net to get a copy of this message
From: coolfr3ak@hotmail.com Operating system: Linux 6.1 PHP version: 4.0.2 PHP Bug Type: *General Issues Bug description: If statement not liking 0 if i have define("_DEFINED_CONSTANT", 0) function xyz ($committype = _DEFINED_CONSTANT) { if ($committype = _DEFINED_CONSTANT) { ...do stuff... } } then the if statement fails to recognise that when a 0 = 0, the statement should be true, instead it returns zero, which is rather anoying... Its a pretty obvious problem - you can try it yourself just put $pug = 0 if ($pug = 0) { echo "foo"; } an it won't recognise it... (it crashes if you ask it for 'if (0 = 0) {...}' for some reason - perhaps another bug? IcK

« previous php.dev (#33224) next »