Pop quiz: can you spot the problem in this PHP snippet? I just got tripped up by it and it was very Not Fun. (This is rewritten to be a minimal example.)

if ( $coolness > 10 ) {
define('COOL_MODE', true);
}

if ( COOL_MODE == true) {
echo 'You are cool.';
}

Follow

@tomw if $coolness <= 10, COOL_MODE never gets initialized?

answer maybe 

@seedyh Yes - and then what happens?

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.