svn: /phpdoc/zh/trunk/language/ functions.xml
| From: | CHU Zhaowei | Date: | Fri, 26 May 2017 15:35:09 +0000 |
| Subject: | svn: /phpdoc/zh/trunk/language/ functions.xml | ||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-4961@lists.php.net to get a copy of this message | ||
jhdxr Fri, 26 May 2017 15:35:09 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=342513
Log:
translation for strict_types
Changed paths:
U phpdoc/zh/trunk/language/functions.xml
Modified: phpdoc/zh/trunk/language/functions.xml
===================================================================
--- phpdoc/zh/trunk/language/functions.xml 2017-05-26 14:00:43 UTC (rev 342512)
+++ phpdoc/zh/trunk/language/functions.xml 2017-05-26 15:35:09 UTC (rev 342513)
@@ -354,26 +354,22 @@
</sect2>
<sect2 xml:id="functions.arguments.type-declaration">
- <title>Type declarations</title>
+ <title>类型声明</title>
<note>
<para>
- Type declarations were also known as type hints in PHP 5.
+ 在PHP 5中,类型声明也被称为类型提示。
</para>
</note>
<para>
- Type declarations allow functions to require that parameters are of a
- certain type at call time. If the given value is of the incorrect type,
- then an error is generated: in PHP 5, this will be a recoverable fatal
- error, while PHP 7 will throw a <classname>TypeError</classname>
- exception.
+ 类型声明允许函数在调用时要求参数为特定类型。
+ 如果给出的值类型不对,那么将会产生一个错误:
+ 在PHP 5中,这将是一个可恢复的致命错误,而在PHP
7中将会抛出一个<classname>TypeError</classname>异常。
</para>
<para>
- To specify a type declaration, the type name should be added before the
- parameter name. The declaration can be made to accept &null; values if
- the default value of the parameter is set to &null;.
+
为了指定一个类型声明,类型应该加到参数名前。这个声明可以通过将参数的默认值设为&null;来实现允许传递&null;。
</para>
<sect3 xml:id="functions.arguments.type-declaration.types">