From 7d94b0f83c3651d7cb4f19ac68b556a196bba1e6 Mon Sep 17 00:00:00 2001 From: Valerij Ivashchenko Date: Sat, 16 Jul 2016 12:34:11 +0300 Subject: [PATCH] Update The-Basics.md Comment "Strict comparisons" over "equality comparisons" code example make confusing. --- pages/The-Basics.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pages/The-Basics.md b/pages/The-Basics.md index 97359d4..ec1798c 100644 --- a/pages/The-Basics.md +++ b/pages/The-Basics.md @@ -20,15 +20,12 @@ var_dump($a == '5'); // compare value (ignore type); return true var_dump($a === 5); // compare type/value (integer vs. integer); return true var_dump($a === '5'); // compare type/value (integer vs. string); return false -/** - * Strict comparisons - */ +//Equality comparisons if (strpos('testing', 'test')) { // 'test' is found at position 0, which is interpreted as the boolean 'false' // code... } -// vs. - +// vs. strict comparisons if (strpos('testing', 'test') !== false) { // true, as strict comparison was made (0 !== false) // code... }