Forgetting double equal-sign in php if-statement
问题 While coding, i sometimes make the error of writing a single = instead of == in an if-statement. So lets say i have this: <?php $name = 'piet'; if($name == 'jan'){ print 'hello jan'; } ?> And i make a mistake and write this instead: <?php $name = 'piet'; if($name = 'jan'){ print 'hello jan'; } ?> This won't throw an error of course, since it is valid php code. However, i never use this short-hand notation, so if i enter it by mistake it will break the logic of my code without telling me why.