Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

(php) if condition not working

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...

like image 488
reggie Avatar asked May 14 '26 03:05

reggie


1 Answers

var_dump($vbulletin->userinfo['userid']);

Output :

string(1)

Your string length is one, and it seems to be empty (a space ?).

like image 62
Matthieu Napoli Avatar answered May 15 '26 17:05

Matthieu Napoli



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!