Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
General
why use 'or'
hewenxiang
August 2012
I'm learning fuelphp from a blog tutorial, but i found author use 'or' not '||' in template. here is the code <?php if (Session::get_flash('success') or Session::get_flash('notice') or Session::get_flash('error')): ?>
....
<?php endif; ?>
Harro
August 2012
It's our coding standard, see
http://docs.fuelphp.com/general/coding_standards.html
. We find 'and' and 'or' easier to read, and there is a subtle difference between' ||' and 'or' which will become appearant if you start mixing them, see
http://www.php.net/manual/en/language.operators.precedence.php
To avoid those issues, we only use 'and' and 'or', and not '&&' or '||'.
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,088
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
260
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
Harro
August 2012