language/operators: 単項演算子と instanceof の優先順位、前置演算子内の代入の結合に関する注記を同期#409
Merged
KentarouTakeda merged 1 commit intoJul 11, 2026
Merged
Conversation
## 概要 php/doc-en@80dfa568 (doc: clarify unary-vs-instanceof precedence and assignment binding inside prefix operators) に追従し、演算子の優先順位に関する注記を2つ追加しました。 ## 翻訳内容 - language/operators/precedence.xml — 単項演算子と instanceof の優先順位、前置演算子内での代入の結合を明確化 1. php/doc-en@80dfa568 追加した注記: - 演算子表の直後 — キャスト演算子と同じ行にある単項演算子 (`~`、`@`、単項の `+`/`-`) は `instanceof` よりも強く結合するが、`!` は弱く結合する。したがって `(int) $x instanceof Foo` は `((int) $x) instanceof Foo` に、 `!$x instanceof Foo` は `!($x instanceof Foo)` にグループ分けされる - `if (!$a = foo())` の注記内 — 代入の左辺は変数でなければならないため、代入は周囲にある 優先順位の高い前置演算子ではなくその変数とグループ分けされる。`clone`、キャスト演算子、 `@`、`~` も同様で、`clone $a = $b` は `clone ($a = $b)` にグループ分けされる 原文の差分は追加のみのため、既存の訳文は変更していません。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
php/doc-en@80dfa568 (doc: clarify unary-vs-instanceof precedence and assignment
binding inside prefix operators) に追従し、演算子の優先順位に関する注記を2つ追加しました。
翻訳内容
追加した注記:
~、@、単項の+/-) はinstanceofよりも強く結合するが、!は弱く結合する。したがって(int) $x instanceof Fooは((int) $x) instanceof Fooに、!$x instanceof Fooは!($x instanceof Foo)にグループ分けされるif (!$a = foo())の注記内 — 代入の左辺は変数でなければならないため、代入は周囲にある優先順位の高い前置演算子ではなくその変数とグループ分けされる。
clone、キャスト演算子、@、~も同様で、clone $a = $bはclone ($a = $b)にグループ分けされる原文の差分は追加のみのため、既存の訳文は変更していません。