Re: Unifying logical operators

From: Date: Tue, 10 Jul 2018 11:09:22 +0000
Subject: Re: Unifying logical operators
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-102702@lists.php.net to get a copy of this message
On 10.07.2018 at 11:01, Rowan Collins wrote: > While I've not seen it used much in PHP code, the "do this or die" idiom is > common in Perl (which also has post-fix "if" and "unless" modifiers, so > those are a different feature again). It seems to me the “do this or die” idiom at least has been very common in PHP. There may still be some occurences in the manual proper, and definitely there are occurences in user contributed notes. > Finally, a note on the "xor" operator - your draft says that this is > equivalent to "!=", but that is not the case, because both can operate on > non-boolean values. Consider "1 != 2" (true) vs "1 xor 2" (false). I > don't > think I've ever had a use for logical xor in PHP code, but there isn't > anything to confuse it with, so no reason to remove it. “xor” is equivalent to ^ (sans the precedence). -- Christoph M. Becker

« previous php.internals (#102702) next »