Modified: phpdoc/ja/trunk/internals2/funcs/index.xml =================================================================== --- phpdoc/ja/trunk/internals2/funcs/index.xml 2014-08-04 14:32:03 UTC (rev 334480) +++ phpdoc/ja/trunk/internals2/funcs/index.xml 2014-08-04 21:16:57 UTC (rev 334481) @@ -1,6 +1,6 @@ - + 関数の作成 @@ -107,7 +107,7 @@ - For clarity, the fully expanded declaration for PHP_FUNCTION(hackers_function) looks like: + 明確にするために、完全に展開した PHP_FUNCTION(hackers_function) のドキュメントを示します。 @@ -117,8 +117,8 @@ - The precense of this_ptr may be confusing, classes are covered in detail in later sections, - suffice to say that PHP_METHOD(MyClass, hackersFunction) would result in the following declaration: + this_ptr の存在を奇妙に感じるかもしれません。クラスの詳細は後ほど説明するとして、ここでは + PHP_METHOD(MyClass, hackersFunction) の結果が次のような宣言になることを示しておけば十分でしょう。 @@ -128,22 +128,27 @@ - hackers_function doesn't do anything useful, it accepts a number using the zend_parse_parameters API, doubles it, and returns it to the engine. - It is obvious that a normal function would have to do something more complex than double the input, for the purposes of education we are keeping it simple. - On entry to the function return_value is allocated and initialized to null, making null the default return value of any function in PHP. + hackers_function は特に凝ったことをするわけではなく、zend_parse_parameters API + を使って受け取った数値を二倍して、それをエンジンに返すだけです。 + 普通は、単に入力を二倍するだけなどではなく、もっと複雑な何かを行うことでしょう。 + ここでは、説明のために、できるだけシンプルにとどめました。 + 関数に入った際に return_value を確保し、null に初期化されます。 + これで、PHP の関数のデフォルトの返り値が null となります。 - If zend_parse_parameters does not recieve what is specified by the Hacker as the correct arguments, and the arguments recieved cannot be converted - to conform with type_spec an error will be raised, and by convention, the Hacker should return immediately. + Hacker が正しい引数として指定する内容を + zend_parse_parameters が受け取れず、受け取った引数を + type_spec を満たす形式に変換できなかった場合は、エラーを発生させます。 + そして、Hacker はその場で return しなければいけません。 - Arrays, Objects, and Resources cannot be converted. + Array、Object、そして Resource は変換できません。 - Parsing Parameters Prototypes + パラメータのプロトタイプのパース @@ -161,29 +166,30 @@ - zend_parse_parameter is available from version 5.5, it behaves like zend_parse_parameters_ex - except that instead of reading the arguments from the stack, it receives a single zval to convert, which may be changed in place. + zend_parse_parameter はバージョン 5.5 以降で使用可能で、zend_parse_parameters_ex と同じような挙動です。 + ただ、引数をスタックから読み込むのではなく、変換対象の zval を受け取って、その場で変換します。 - flags is intended to be a mask, currently only ZEND_PARSE_PARAMS_QUIET will have any impact (supress warnings) + flags はマスクとして扱うことを想定しています。現時点で有効なフラグは ZEND_PARSE_PARAMS_QUIET だけです (これは、警告を抑制します)。 - The variable arguments recieved by these API functions are expected to be the address of C variables, and should be considered the output of the zend_parse_parameters API functions. + これらの API 関数から受け取る可変引数は、C の変数のアドレスであることが期待されています。 + また、zend_parse_parameters API 関数の出力であると考えなければいけません。
- Type Specifiers + 型指定子 - Spec - Type - Locals + 指定子 + 型 + ローカル @@ -194,7 +200,7 @@ A - array or object + array あるいは object zval* @@ -224,7 +230,7 @@ H - array or object + array あるいは object HashTable* @@ -234,7 +240,7 @@ L - long (limits out-of-range LONG_MAX/LONG_MIN) + long (LONG_MAX/LONG_MIN の範囲に収まるもの) long @@ -244,12 +250,12 @@ O - object (of specified zend_class_entry) + object (指定した zend_class_entry のもの) zval*, zend_class_entry* p - string (a valid path) + string (有効なパス) char*, int @@ -278,64 +284,69 @@ - Where the type specifier is O, the local zend_class_entry* is to be - considered input (part of the type spec) to zend_parse_parameter + 型指定子が O の場合、ローカルの zend_class_entry* は + zend_parse_parameter への入力 (型指定子の一部) と見なされます。
- Advanced Type Specifiers + 高度な型指定子 - Spec - Description + 指定子 + 説明 * - a variable number of argument of the preceeding type, 0 or more + 直前の型の引数が 0 個以上 + - a variable number of argument of the preceeding type, 1 or more + 直前の型の引数が 1 個以上 | - indicates that the remaining parameters are optional + 残りのパラメータは任意である / - SEPARATE_ZVAL_IF_NOT_REF on the parameter it follows + 後に続くパラメータを SEPARATE_ZVAL_IF_NOT_REF します。 ! - the preceeding parameter can be of the specified type or null - For 'b', 'l' and 'd', an extra argument of type zend_bool* must be passed after - the corresponding bool*, long* or double* - addresses which will be set true if null is recieved. + 直前のパラメータが、指定した型あるいは null のどちらかになるものとします。 + 'b'、'l'、'd' の場合は、対応する bool*、long*、double* + の後に zend_bool* 型の引数を追加する必要があります。null + を受け取った場合は、ここに true が設定されます。
- Consult README.PARAMETER_PARSING_API included in source distributions for more information on parsing parameters + パラメータのパースについての詳細は、ソース配布物に含まれる README.PARAMETER_PARSING_API を参照ください。 - Once the Hacker's function has executed whatever it was implemented to execute, it is time to set the return_value for the engine. - The RETURN_ and RETVAL_ macros are just wrappers around Z_*_P macros that work with return_value. + 一度 Hacker の関数が実行されたら、実行するよう実装されているかどうかにかかわらず、エンジン向けの return_value を設定します。 + RETURN_ マクロと RETVAL_ マクロは + Z_*_P の単なるラッパーで、return_value と組み合わせて使います。 - RETURN_ macros cause execution to leave the function immediately (ie: return;), while RETVAL_ macros allow execution to continue after return_value has been set. + + RETURN_ マクロはその場で関数の実行を終了します (つまり、return; します) が、 + RETVAL_ は、return_value を設定してからも実行を続けます。 + - The Hacker should now have a reasonable understanding of the anatomy of a function, and to some degree, the anatomy of a method. + これで、関数の仕組みについて、それなりに理解できたことでしょう。 + メソッドの仕組みについても、ある程度は理解できたはずです。
Modified: phpdoc/ja/trunk/language/constants.xml =================================================================== --- phpdoc/ja/trunk/language/constants.xml 2014-08-04 14:32:03 UTC (rev 334480) +++ phpdoc/ja/trunk/language/constants.xml 2014-08-04 21:16:57 UTC (rev 334481) @@ -1,6 +1,6 @@ - + @@ -231,9 +231,6 @@ ファイルのフルパスとファイル名。インクルードされるファイルの 中で使用された場合、インクルードされるファイルの名前が返されます。 - PHP 4.0.2 以降では __FILE__ - は常に絶対パスで、シンボリックリンクは解決されます。 - それより前のバージョンでは、場合によっては相対パスが返されることもあります。 @@ -242,24 +239,19 @@ そのファイルの存在するディレクトリ。include の中で使用すると、 インクルードされるファイルの存在するディレクトリを返します。 つまり、これは dirname(__FILE__) と同じ意味です。 - ルートディレクトリである場合を除き、ディレクトリ名の末尾にスラッシュはつきません - (PHP 5.3.0 で追加されました)。 + ルートディレクトリである場合を除き、ディレクトリ名の末尾にスラッシュはつきません。 __FUNCTION__ - 関数名(PHP4.3.0で追加されました)。 - PHP 5以降、この定数は宣言時の関数名(ケース依存)を返します。 - PHP 4では、この値は常に小文字で返されました。 + 関数名。 __CLASS__ - クラス名(PHP4.3.0で追加されました)。 - PHP 5以降、この定数は宣言時のクラス名(ケース依存)を返します。 - PHP 4では、この値は常に小文字で返されました。 + クラス名。 クラス名には、そのクラスが宣言されている名前空間も含みます (例 Foo\Bar)。 PHP 5.4 以降では、__CLASS__ がトレイトでも使えることに注意しましょう。トレイトのメソッド内で @@ -269,25 +261,21 @@ __TRAIT__ - トレイト名 (PHP 5.4.0 で追加されました)。PHP 5.4 以降では、 - この定数はトレイト名を宣言時のままで返します (大文字小文字を区別します)。 + トレイト名 トレイト名には、宣言された名前空間も含みます (例 Foo\Bar)。 - __METHOD__ - クラスのメソッド名(PHP5.0.0で追加されました)。 - メソッド名は宣言時と同じ(ケース依存)を返します。 + クラスのメソッド名。 __NAMESPACE__ - 現在の名前空間の名前 (大文字小文字を区別します)。 - この定数はコンパイル時に定義されます (PHP 5.3.0 で追加されました)。 + 現在の名前空間の名前。 @@ -300,7 +288,63 @@ file_exists, function_existsも参照してください。 + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + 5.4.0 + + __TRAIT__ が追加されました。 + + + + 5.3.0 + + __DIR__ と __NAMESPACE__ が追加されました。 + + + + 5.0.0 + + __METHOD__ が追加されました。 + + + + 5.0.0 + + これより前のバージョンでは、マジック定数のうちのいくつかが、常に小文字化されていました。 + このバージョン以降は、すべて大文字小文字を区別する (宣言したとおりに設定される) ようになります。 + + + + 4.3.0 + + __FUNCTION__ と __CLASS__ が追加されました。 + + + + 4.0.2 + + __FILE__ に常に絶対パスを含め、シンボリックリンクも解決するようになりました。 + これより前のバージョンでは、場合によっては相対パスが含まれていることもありました。 + + + + + + + @@ -324,4 +368,3 @@ vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> - Modified: phpdoc/ja/trunk/language/variables.xml =================================================================== --- phpdoc/ja/trunk/language/variables.xml 2014-08-04 14:32:03 UTC (rev 334480) +++ phpdoc/ja/trunk/language/variables.xml 2014-08-04 21:16:57 UTC (rev 334481) @@ -1,6 +1,6 @@ - + 変数 @@ -1071,7 +1071,7 @@ - 変更履歴 + &reftitle.changelog; Modified: phpdoc/ja/trunk/reference/classobj/functions/is-subclass-of.xml =================================================================== --- phpdoc/ja/trunk/reference/classobj/functions/is-subclass-of.xml 2014-08-04 14:32:03 UTC (rev 334480) +++ phpdoc/ja/trunk/reference/classobj/functions/is-subclass-of.xml 2014-08-04 21:16:57 UTC (rev 334481) @@ -1,6 +1,6 @@ - + @@ -29,6 +29,7 @@ クラス名あるいはオブジェクトのインスタンス。 + そのクラスが存在しなくても、エラーにはなりません。