diff --git a/code/boolean-logic.php b/code/boolean-logic.php index 2fc1c28..f297c94 100644 --- a/code/boolean-logic.php +++ b/code/boolean-logic.php @@ -14,7 +14,7 @@ $a && $b; $a && $c; // Using two pipe characters checks if either value is true. -// Then, it will return true. If both values are false, the PHP +// Then, it will return true. If both values are false, then PHP // returns false. $a = true; $b = false; diff --git a/code/comparisons.php b/code/comparisons.php index 54f8584..444c853 100644 --- a/code/comparisons.php +++ b/code/comparisons.php @@ -2,7 +2,7 @@ // A boolean is a value that is always 0 or 1, yes or no, on or off. // In PHP, a boolean is represented by the words true and false. -// While programming, you will often want to know if something is true or false. +// While programming, you will often want to know if something is positive or negative. $a = true; $b = false; @@ -35,7 +35,13 @@ $one >= $two; // by using three equal signs. // This returns true. +1 == 1; 1 == '1'; +1 == true; +1 == 1.0; +1 === 1; // This returns false. 1 === '1'; +1 === true; +1 === 1.0; diff --git a/code/conditionals.php b/code/conditionals.php index 3187762..d2b8d17 100644 --- a/code/conditionals.php +++ b/code/conditionals.php @@ -62,7 +62,7 @@ switch ($drink) { $language = 'english'; echo $language == 'spanish' ? "hola\n" : "hello\n"; -// Lastly, there is another form of a ternary that checks if a value is set and then returns the value to the right of two question marks if value is null. +// Lastly, there is another form of a ternary that checks if a value is set and then returns the value to the right of the two question marks if the value is null. echo $IDoNotExist ?? "Variable not set\n"; // You can also chain multiple checks in a row.