if (!is_int($status) || is_int($status) && !isset($this->responseMap[$status]))
https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/application/web.php#L562
maybe
if (!is_int($status) && !isset($this->responseMap[$status]))
or
if (!is_int($status) || (is_int($status) && !isset($this->responseMap[$status])))
or
if (!is_int($status) && !isset($this->responseMap[$status]))
Labels |
Added:
?
|
Category | ⇒ | Libraries |
The first one fails because your starting to check for non-integer keys in the responseMap array which starts to lead to odd behaviour.
The third one is the same as the first one.
The second one is fine - but honestly this code is likely about to get refactored with #16040 anyhow. So not sure how relevant this is
if (is_int($status) && !isset($this->responseMap[$status]))
or
if (!isset($this->responseMap[$status]))
because (!is_int($status) || is_int($status)) === true
@rumours86 You are wrong because of operator precedence: && comes before ||. Same as in maths with multiplication coming before sum
Status | New | ⇒ | Discussion |
@rumours86 See http://php.net/manual/en/language.operators.precedence.php
Does anybody agree with me that we can close this issue? It seems @rumours86 does not reply.
As I have shown in my previous 2 posts, this issue here is caused by a misunderstanding of operators precedence in PHP.
@richard67 i think you right
example https://middle.valyaev.su/1.php
@rumours86 Could you close this issue in the issue tracker or on github then?
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-05-25 13:13:17 |
Closed_By | ⇒ | rumours86 |
@richard67 Thanks for clarifying
That is 3 year old code from @wilsonge a322a43