Skip to content

Conversation

@takaram
Copy link
Contributor

@takaram takaram commented Apr 1, 2025

strr?i?pos, strstr等の$needleに数値を渡したときの動作について、2点の誤訳を修正しています。

原文:

Prior to PHP 8.0.0, if needle is not a string, it is converted to an integer and applied as the ordinal value of a character. This behavior is deprecated as of PHP 7.3.0, and relying on it is highly discouraged. Depending on the intended behavior, the needle should either be explicitly cast to string, or an explicit call to chr() should be performed.

  • the ordinal value of a character
    • ordinary と取り違えたのかと思います。直訳すると「文字の序数値」みたいになるようですが、分かりづらいので「コードポイント」と意訳しています。
  • Depending on the intended behavior
    • depending on ~ = ~に応じて

Copy link
Collaborator

@KentarouTakeda KentarouTakeda left a comment

Choose a reason for hiding this comment

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

ありがとうございます!大変細やかな箇所まで見つけて頂き、感謝しています!

@KentarouTakeda KentarouTakeda merged commit 5722d0a into php:master Apr 2, 2025
2 checks passed
@takaram takaram deleted the needle branch April 2, 2025 12:59
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