ID:               27061
 Updated by:       [EMAIL PROTECTED]
 Reported By:      PAUL_MYERS at YAHOO dot COM
-Status:           Open
+Status:           Bogus
 Bug Type:         Output Control
 Operating System: windows and GNULinux
 PHP Version:      4.3.4
 New Comment:

Use '===' and '!==' there. This is not bug..



Previous Comments:
------------------------------------------------------------------------

[2004-01-27 12:55:02] PAUL_MYERS at YAHOO dot COM

Description:
------------
running the code below will ouput the weekday value and the Unix
datecode! - obviously I have shortened my code so this is non relevant
as there is another way but I'm not sure this should happen (it would
be interesting to know why?)
this can be resolved by changing 
if ($element[key] == "weekday" )

to 

if ($element[key] == "weekday" && $element[key] != "0")

Reproduce code:
---------------
<html>
<body>
<?      
$timestamp = date ("U");
        $day1a = getdate ($timestamp);
        while ( $element = each ($day1a)) {
          if ($element[key] == "weekday" )  {
            $day = $element[value];
            echo " Day ";
            echo $day;
            echo "<br><br>";
          }
        }
?>
</body>
</html>

Expected result:
----------------
Day Tuesday


Actual result:
--------------
Day Tuesday

Day 1075224592




------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=27061&edit=1

Reply via email to