Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/update operators.precedence #509

Merged
merged 1 commit into from
Apr 12, 2021
Merged

Fix/update operators.precedence #509

merged 1 commit into from
Apr 12, 2021

Conversation

guilliamxavier
Copy link
Contributor

  • explain why associativity is not applicable to unary operators
  • distinguish between unary and binary +/-
  • add some missing reference links
  • update the precedence of string concatenation for PHP 8
  • fix "(n/a)" ("not applicable") to "non-associative" for ternary

References:

- explain why associativity is not applicable to unary operators
- distinguish between unary and binary `+`/`-`
- add some missing reference links
- update the precedence of string concatenation for PHP 8
- fix "(n/a)" ("not applicable") to "non-associative" for ternary

References:
- https://github.com/php/php-src/blob/master/Zend/zend_ast.c
  (search "Operator Precedence")
- https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y
  (search "precedence")
  (NOTE: in opposite order)
@guilliamxavier
Copy link
Contributor Author

Notes:

  • Actually I had started with just "update the precedence of string concatenation for PHP 8" but that triggered a cascade of related small changes 😅
  • About the table layout: before and after the changes 🤔 Maybe we could add a style white-space: nowrap to the first two columns (result), or insert some line breaks (example)... WDYT?

@cmb69
Copy link
Member

cmb69 commented Apr 12, 2021

Thank you for the very good PR! I'm going to merge it.

About the table layout: before and after the changes 🤔 Maybe we could add a style white-space: nowrap to the first two columns (result), or insert some line breaks (example)... WDYT?

Many tables in the manual have issues (e.g. https://www.php.net/manual/en/filter.filters.validate.php overflows in small browser windows), and often, in my opinion, the best solution would be to replace the tables with lists. In this case I think it might be best to link the operators in the 2nd column directly and add availability info there, and to drop the third column altogether.

@cmb69 cmb69 merged commit 011596b into php:master Apr 12, 2021
@guilliamxavier guilliamxavier deleted the patch-1 branch April 12, 2021 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants