Ok, I fear that this is just me having forgotten some small stupid thing about PHP, but I just can't seem to figure out what is going on here.
Test code:
<?php header('Content-Type: text/plain');
$closingDate = mktime(23, 59, 59, 3, 27, 2009);
function f1()
{
return time() > $closingDate;
}
function f2()
{
return time() < $closingDate;
}
printf(' Time: %u
Closing: %u
t > c: %u
f1 : %u
t < c: %u
f2 : %u',
time(),
$closingDate,
time() > $closingDate,
f1(),
time() < $closingDate,
f2());
The problem is that the output doesn't make sense to me at all. And I don't get why it turns out like it does:
Time: 1235770914
Closing: 1238194799
t > c: 0
f1 : 1
t < c: 1
f2 : 0
Why doesn't the function output the same result as the code inside the function?? What am I not getting here? Have I looked myself completely blind on my own code? What is going on?