Skip to content

Commit de17c45

Browse files
author
Yoshinari Takaoka
committed
Reflection can now get defaults for internals
git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@350521 c90b9560-bf6c-de11-be94-00142212c4b1
1 parent 9a4def4 commit de17c45

File tree

2 files changed

+54
-25
lines changed

2 files changed

+54
-25
lines changed

reference/reflection/reflectionparameter/getdefaultvalue.xml

Lines changed: 27 additions & 12 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: 5383ecabcb6e24c514ce79f0d111bf6aec65b9cb Maintainer: takagi Status: ready -->
3+
<!-- EN-Revision: ecd72af657b9168e492092b998b9777cabcb0c30 Maintainer: takagi Status: ready -->
44
<!-- Credits: mumumu -->
55

66
<refentry xml:id="reflectionparameter.getdefaultvalue" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
@@ -16,7 +16,7 @@
1616
<void />
1717
</methodsynopsis>
1818
<para>
19-
ユーザー定義の関数あるいはメソッドで、パラメータのデフォルト値を取得します。
19+
(内部またはユーザー定義の) 関数あるいはメソッドで、パラメータのデフォルト値を取得します。
2020
省略可能なパラメータでない場合は <classname>ReflectionException</classname>
2121
がスローされます。
2222
</para>
@@ -34,6 +34,31 @@
3434
</para>
3535
</refsect1>
3636

37+
<refsect1 role="changelog">
38+
&reftitle.changelog;
39+
<para>
40+
<informaltable>
41+
<tgroup cols="2">
42+
<thead>
43+
<row>
44+
<entry>&Version;</entry>
45+
<entry>&Description;</entry>
46+
</row>
47+
</thead>
48+
<tbody>
49+
<row>
50+
<entry>8.0.0</entry>
51+
<entry>
52+
ビルトイン関数 や ビルトインクラス のメソッドについても、デフォルト値を取得できるようになりました。
53+
これより前のバージョンでは、<classname>ReflectionException</classname> がスローされていました。
54+
</entry>
55+
</row>
56+
</tbody>
57+
</tgroup>
58+
</informaltable>
59+
</para>
60+
</refsect1>
61+
3762
<refsect1 role="examples">
3863
&reftitle.examples;
3964
<para>
@@ -72,16 +97,6 @@ Default value: baz
7297
</para>
7398
</refsect1>
7499

75-
<refsect1 role="notes">
76-
&reftitle.notes;
77-
<note>
78-
<para>
79-
実装上の理由で、組み込みの関数や組み込みクラスのメソッドのデフォルト値を取得することはできません。
80-
実行しようとすると <classname>ReflectionException</classname> がスローされます。
81-
</para>
82-
</note>
83-
</refsect1>
84-
85100
<refsect1 role="seealso">
86101
&reftitle.seealso;
87102
<para>

reference/reflection/reflectionparameter/getdefaultvalueconstantname.xml

Lines changed: 27 additions & 13 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: 5383ecabcb6e24c514ce79f0d111bf6aec65b9cb Maintainer: takagi Status: ready -->
3+
<!-- EN-Revision: ecd72af657b9168e492092b998b9777cabcb0c30 Maintainer: takagi Status: ready -->
44
<!-- Credits: mumumu -->
55

66
<refentry xml:id="reflectionparameter.getdefaultvalueconstantname" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
@@ -17,7 +17,7 @@
1717
</methodsynopsis>
1818
<para>
1919
デフォルト値が定数か null の場合に、
20-
ユーザーが定義した関数またはメソッドのパラメータのデフォルト値を返します
20+
(内部またはユーザー定義の) 関数やメソッドのデフォルト値の定数名を返します
2121
パラメータがオプションでない場合は、
2222
<classname>ReflectionException</classname> がスローされます。
2323
</para>
@@ -35,6 +35,31 @@
3535
</para>
3636
</refsect1>
3737

38+
<refsect1 role="changelog">
39+
&reftitle.changelog;
40+
<para>
41+
<informaltable>
42+
<tgroup cols="2">
43+
<thead>
44+
<row>
45+
<entry>&Version;</entry>
46+
<entry>&Description;</entry>
47+
</row>
48+
</thead>
49+
<tbody>
50+
<row>
51+
<entry>8.0.0</entry>
52+
<entry>
53+
ビルトイン関数 や ビルトインクラス のメソッドについても、デフォルト値の定数名を取得できるようになりました。
54+
これより前のバージョンでは、<classname>ReflectionException</classname> がスローされていました。
55+
</entry>
56+
</row>
57+
</tbody>
58+
</tgroup>
59+
</informaltable>
60+
</para>
61+
</refsect1>
62+
3863
<refsect1 role="examples">
3964
&reftitle.examples;
4065
<para>
@@ -73,17 +98,6 @@ Default value: PHP_INT_MIN
7398
</para>
7499
</refsect1>
75100

76-
<refsect1 role="notes">
77-
&reftitle.notes;
78-
<note>
79-
<para>
80-
実装の詳細になるため、
81-
ビルトイン関数やビルトインクラスのメソッドのデフォルト値を取得することはできません。
82-
取得を試みると、<classname>ReflectionException</classname> がスローされます。
83-
</para>
84-
</note>
85-
</refsect1>
86-
87101
<refsect1 role="seealso">
88102
&reftitle.seealso;
89103
<para>

0 commit comments

Comments
 (0)