CodeIgniter Forums
CI doc says == FALSE. Why isn't it === false? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: CI doc says == FALSE. Why isn't it === false? (/showthread.php?tid=67717)



CI doc says == FALSE. Why isn't it === false? - castle - 03-31-2017

Hello,

At https://codeigniter.com/user_guide/libraries/form_validation.html?highlight=form you have the comparison:
PHP Code:
if ($this->form_validation->run() == FALSE


Two questions from the above code:

1) The doc says that it returns a boolean result. So, why doesn't it use the "===" operator?
2) PSR-2 says that the constants true, false, and null MUST be in lower case. Would make any difference if I switch FALSE to false in the above example?

Thank you,
C


RE: CI doc says == FALSE. Why isn't it === false? - Narf - 03-31-2017

1) Because it's practically irrelevant and whoever wrote it wasn't pedantic.
2) PSR-2 is a crappy collection of arbitrary rules, that the FIG is marketing as a standard. It won't make a difference.


RE: CI doc says == FALSE. Why isn't it === false? - castle - 03-31-2017

Fair enough. Thanks!