I am going crazy here. The following simple if-condition does not produce the right output.
$xxx = 1;
if($xxx == 1)
define('DEBUG', true);
else
define('DEBUG', false);
var_dump($xxx);
var_dump(DEBUG);
die();
Output:
int(1)
bool(false)
I see absolutely no reason why the DEBUG constant is not being set to true. PHP's type juggling should allow this if-statement. And even if I put an intval in front of the variable, it still produces false as output.
Edit 2: I copied the exact code from above into a new file and it produces the expected output. So I don't know what is going on...
string(1)is an indication of the length of the string, not its value. tryecho $vbulletin->userinfo['userid'];to see what its value actually is.$vbulletin->userinfo['userid']as an int anyway?userid: As Brian mentioned the(1)indicates the length, but usually the content follows after that.DEBUG(orprint_r(get_defined_constants());) before you define it and see what the output is in both cases. It appears that you can "redefine" if one define statement includes the is_case_sensitive flag...