Advertisement
zero50x

CodeStyle от Жени

Jun 30th, 2015
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. /* НИКОГДА ТАК НЕ ДЕЛАЙ! */
  2. function AND($a, $b)
  3. {
  4.     if ($a === true) {
  5.         if ($b === true) {
  6.             return true;
  7.         } else {
  8.             return false;
  9.         }
  10.     } else {
  11.         return false;
  12.     }
  13. }
  14.  
  15. /* Зависит от ситуации */
  16. function AND($a, $b)
  17. {
  18.     if ($a === true) {
  19.         if ($b === true) {
  20.             return true;
  21.         }
  22.     }
  23.     return false;
  24. }
  25.  
  26. /* Легко и не принужденно */
  27. function AND($a, $b)
  28. {
  29.     if ($a === false) return false;
  30.     if ($b === false) return false;
  31.     return true;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement