Skip to content

Commit f8bcfe2

Browse files
committed
Clarify return value of strcmp() and friends
php/doc-en@40364a6
1 parent 73d38a4 commit f8bcfe2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

appendices/migration82/other-changes.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: d5a469df43e34526de33d5ee0e9f8788af2fe443 Maintainer: mumumu Status: ready -->
3+
<!-- EN-Revision: 40364a64d707d6ec49f6870045807c93e09dba6d Maintainer: mumumu Status: ready -->
44
<sect1 xml:id="migration82.other-changes" xmlns:xlink="http://www.w3.org/1999/xlink">
55
<title>その他の変更</title>
66

@@ -50,7 +50,10 @@
5050
<function>strcmp</function>, <function>strcasecmp</function>,
5151
<function>strncmp</function>, <function>strncasecmp</function>,
5252
<function>substr_compare</function> は、
53-
<literal>-1</literal>, <literal>0</literal>, <literal>1</literal> を返すようになりました。
53+
比較対象の文字列の長さが等しくないときに <code>strlen($string1) - strlen($string2)</code> を返すことが保証されなくなり、
54+
<literal>-1</literal> や <literal>1</literal> を返すようになりました。
55+
返される具体的な値に依存する代わりに、これらの関数の戻り値は
56+
<literal>0</literal> と比較すべきです。
5457
</para>
5558
</sect3>
5659

0 commit comments

Comments
 (0)