note 78166 modified in language.operators.logical by hholzgra

From: Date: Thu, 02 Aug 2012 15:12:08 +0000
Subject: note 78166 modified in language.operators.logical by hholzgra
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-189831@lists.php.net to get a copy of this message
$test = true and false; ---> $test === true
$test = (true and false); ---> $test === false
$test = true && false; ---> $test === false

NOTE: this is due to the first line actually being

($test = true) and false;

due to "&&" having a higher precedence than "=" while "and" has a lower one --was-- $test = true and false; ---> $test === true $test = (true and false); ---> $test === false $test = true && false; ---> $test === false http://php.net/manual/en/language.operators.logical.php

« previous php.notes (#189831) next »