Skip to content
This repository was archived by the owner on Nov 21, 2019. It is now read-only.

Conversation

@thewilkybarkid
Copy link
Contributor

No description provided.

@thewilkybarkid thewilkybarkid added the feature New feature or request label Dec 20, 2018
@thewilkybarkid thewilkybarkid added this to the 0.4.0 milestone Dec 20, 2018
@thewilkybarkid thewilkybarkid requested a review from a team as a code owner December 20, 2018 14:31
switch ($quuz) {
case true:
case false:
return $corge / (100 + $grault);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious about the effect on (60 * 60 * 24) * $days (or similar) which has unnecessary parentheses but can make the calculation more clear

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better test case:

$ php -r "var_dump(true or false and false);"       
bool(true)
$ php -r "var_dump(true or (false and false));"     
bool(true)
$ php -r "var_dump((true or false) and false);"     
bool(false)

The second case has unnecessary parentheses but is counterintuitive without them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All those examples are unaffected.

((60 * 60 * 24 * $days) is also unaffected when it is useless though.)

@giorgiosironi
Copy link

The build contains an unrelated error, but the concerns about parentheses have been addressed.

@thewilkybarkid
Copy link
Contributor Author

Build problem is addressed in #37.

@thewilkybarkid thewilkybarkid merged commit f611ae9 into libero:master Feb 15, 2019
@thewilkybarkid thewilkybarkid deleted the parentheses branch February 15, 2019 10:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants