Doc #71016 [Opn]: Documentation issue regarding the "or" logical operator
Edit report at https://bugs.php.net/bug.php?id=71016&edit=1
ID: 71016
Updated by: requinix@php.net
Reported by: henrywright at gmail dot com
Summary: Documentation issue regarding the "or" logical
operator
Status: Open
Type: Documentation Problem
Package: Documentation problem
Operating System: Linux
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
That's correct, the true is still "evaluated". Being a literal value, when it gets
evaluated nothing happens, so in that sense it is ignored (it has no effect on anything). It could
also be that the docs mean that true is ignored as far as $f is concerned (as in it has no effect on
$f).
If you have a suggestion for how to improve the wording, click the Edit link in the top-right corner
of the manual page, log in or stay anonymous, then make and submit a patch to the documentation.
Previous Comments:
------------------------------------------------------------------------
[2015-12-03 13:20:44] henrywright at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/language.operators.logical
---
The snippet below is taken directly from the manual page above. The comment mentions that true is
ignored but I believe that isn't quite true. Granted true doesn't effect the value of $f,
but I believe it has an effect on the entire expression overall.
Snippet from manual:
// The constant false is assigned to $f and then true is ignored
// Acts like: (($f = false) or true)
$f = false or true;
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71016&edit=1
Thread (4 messages)