Skip to content

Commit

Permalink
Update appendices
Browse files Browse the repository at this point in the history
  • Loading branch information
mowangjuanzi committed Oct 28, 2023
1 parent 9a30f6b commit 87e3085
Show file tree
Hide file tree
Showing 7 changed files with 152 additions and 267 deletions.
6 changes: 2 additions & 4 deletions appendices/migration71.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@

<sect1 annotations="chunk:false" xml:id="migration71.intro">
<para>
这个新的小版本带来了大量的
<link linkend="migration71.new-features">新特性</link>和
<link linkend="migration71.incompatible">少量的兼容性调整</link>
在生产环境切换 PHP 版本前应该进行相关测试。
这个新的小版本带来了大量的<link linkend="migration71.new-features">新特性</link>和<link
linkend="migration71.incompatible">少量的兼容性调整</link>在生产环境切换 PHP 版本前应该进行相关测试。
</para>
<para>
&manual.migration.seealso;
Expand Down
4 changes: 2 additions & 2 deletions appendices/migration71/constants.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</sect2>

<sect2 xml:id="migration71.constants.filter">
<title><link linkend="book.filter">Data Filtering</link></title>
<title><link linkend="book.filter">数据过滤</link></title>

<itemizedlist>
<listitem>
Expand All @@ -53,7 +53,7 @@
</sect2>

<sect2 xml:id="migration71.constants.image">
<title><link linkend="book.image">Image Processing and GD</link></title>
<title><link linkend="book.image">图像处理和 GD</link></title>

<itemizedlist>
<listitem>
Expand Down
236 changes: 81 additions & 155 deletions appendices/migration71/incompatible.xml

Large diffs are not rendered by default.

54 changes: 26 additions & 28 deletions appendices/migration71/new-features.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 459c0e1de40c71062731abb431ec1c9f74b2aaf2 Maintainer: jhdxr Status: ready -->
<!-- Reviewed: no -->

<!-- CREDITS: mowangjuanzi -->
<sect1 xml:id="migration71.new-features" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>新特性</title>

Expand Down Expand Up @@ -61,9 +60,9 @@ Uncaught Error: Too few arguments to function test(), 0 passed in...
<title>Void 函数</title>

<para>
一个新的返回值类型<type>void</type>被引入。
返回值声明为 void 类型的方法要么干脆省去 return 语句,要么使用一个空的 return 语句。
对于 void 函数来说,&null; 不是一个合法的返回值。
一个新的返回值类型 <type>void</type> 被引入。返回值声明为 void
类型的方法要么干脆省去 return 语句,要么使用一个空的 return 语句。 对于
void 函数来说,&null; 不是一个合法的返回值。
</para>

<informalexample>
Expand Down Expand Up @@ -102,10 +101,10 @@ int(1)
</sect2>

<sect2 xml:id="migration71.new-features.symmetric-array-destructuring">
<title>Symmetric array destructuring</title>
<title>对称(Symmetric)数组解构</title>

<para>
短数组语法(<literal>[]</literal>)现在作为<function>list</function>语法的一个备选项,可以用于将数组的值赋给一些变量(包括在<literal>foreach</literal>中)。
短数组语法(<literal>[]</literal>)现在作为 <function>list</function> 语法的一个备选项,可以用于将数组的值赋给一些变量(包括在 <literal>foreach</literal> 中)。
</para>

<informalexample>
Expand Down Expand Up @@ -164,11 +163,11 @@ class ConstDemo
<title><type>iterable</type> 伪类</title>

<para>
现在引入了一个新的被称为<type>iterable</type>的伪类 (与<type>callable</type>类似)。
这可以被用在参数或者返回值类型中,它代表接受数组或者实现了<classname>Traversable</classname>接口的对象。
至于子类,当用作参数时,子类可以收紧父类的<type>iterable</type>类型到<type>array</type>
或一个实现了<classname>Traversable</classname>的对象。对于返回值,子类可以拓宽父类的
<type>array</type>或对象返回值类型到<type>iterable</type>。
现在引入了一个新的被称为 <type>iterable</type> 的伪类 (与 <type>callable</type> 类似)。
这可以被用在参数或者返回值类型中,它代表接受数组或者实现了 <classname>Traversable</classname> 接口的对象。
至于子类,当用作参数时,子类可以收紧父类的 <type>iterable</type> 类型到 <type>array</type>
或一个实现了 <classname>Traversable</classname> 的对象。对于返回值,子类可以拓宽父类的
<type>array</type> 或对象返回值类型到 <type>iterable</type>。
</para>

<informalexample>
Expand All @@ -190,7 +189,7 @@ function iterator(iterable $iter)
<title>多异常捕获处理</title>

<para>
一个catch语句块现在可以通过管道字符(<literal>|</literal>)来实现多个异常的捕获。
一个catch语句块现在可以通过管道字符<literal>|</literal>来实现多个异常的捕获。
这对于需要同时处理来自不同类的不同异常时很有用。
</para>

Expand All @@ -209,10 +208,10 @@ try {
</sect2>

<sect2 xml:id="migration71.new-features.support-for-keys-in-list">
<title><function>list</function>现在支持键名</title>
<title><function>list</function> 现在支持键名</title>

<para>
现在<function>list</function>和它的新的<literal>[]</literal>语法支持在它内部去指定键名。这意味着它可以将任意类型的数组
现在 <function>list</function> 和它的新的 <literal>[]</literal> 语法支持在它内部去指定键名。这意味着它可以将任意类型的数组
都赋值给一些变量(与短数组语法类似)
</para>

Expand Down Expand Up @@ -249,8 +248,9 @@ foreach ($data as ["id" => $id, "name" => $name]) {
<title>支持为负的字符串偏移量</title>

<para>
现在所有支持偏移量的<link linkend="book.strings">字符串操作函数</link>
都支持接受负数作为偏移量,包括通过<literal>[]</literal>或<literal>{}</literal>操作<link linkend="language.types.string.substr">字符串下标</link>。在这种情况下,一个负数的偏移量会被理解为一个从字符串结尾开始的偏移量。
现在所有支持偏移量的<link
linkend="book.strings">字符串操作函数</link>都支持接受负数作为偏移量,包括通过 <literal>[]</literal>
或 <literal>{}</literal> 操作<link linkend="language.types.string.substr">字符串下标</link>。在这种情况下,一个负数的偏移量会被理解为一个从字符串结尾开始的偏移量。
</para>

<informalexample>
Expand All @@ -271,8 +271,7 @@ int(3)
</informalexample>

<para>
Negative string and array offsets are now also supported in the simple
variable parsing syntax inside of strings.
在字符串的简单变量解析语法中,现在也支持字符串和数组的负偏移量。
</para>

<informalexample>
Expand All @@ -297,17 +296,17 @@ The last character of 'bar' is 'r'.
<title>ext/openssl 支持 AEAD</title>

<para>
通过给<function>openssl_encrypt</function><function>openssl_decrypt</function>
添加额外参数,现在支持了AEAD (模式 GCM and CCM)
通过给 <function>openssl_encrypt</function><function>openssl_decrypt</function>
添加额外参数,现在支持了 AEAD(模式 GCM CCM
</para>
</sect2>

<sect2 xml:id="migration71.new-features.convert-callables-to-closures">
<title>通过 <methodname>Closure::fromCallable</methodname> 将callables转为闭包</title>
<title>通过 <methodname>Closure::fromCallable</methodname> 将 callables 转为闭包</title>

<para>
<classname>Closure</classname>新增了一个静态方法,用于将<type>callable</type>快速地
转为一个<classname>Closure</classname> 对象。
<classname>Closure</classname> 新增了一个静态方法,用于将 <type>callable</type> 快速地
转为 <classname>Closure</classname> 对象。
</para>

<informalexample>
Expand Down Expand Up @@ -345,7 +344,7 @@ string(10) "some value"

<para>
一个新的名为 <function>pcntl_async_signals</function> 的方法现在被引入,
用于启用无需 ticks (这会带来很多额外的开销)的异步信号处理。
用于启用无需 ticks(这会带来很多额外的开销)的异步信号处理。
</para>

<informalexample>
Expand All @@ -371,11 +370,10 @@ SIGHUP
</sect2>

<sect2 xml:id="migration71.new-features.http2-server-push-support-in-ext-curl">
<title>HTTP/2 server push support in ext/curl</title>
<title>ext/curl 中支持 HTTP/2 服务器推送</title>

<para>
对服务器推送的支持现在已经被加入到 CURL 扩展中(
需要版本 7.46 或更高)。这个可以通过
对服务器推送的支持现在已经被加入到 CURL 扩展中(需要版本 7.46 或更高)。这个可以通过
<function>curl_multi_setopt</function> 函数与新的常量
<constant>CURLMOPT_PUSHFUNCTION</constant> 来进行调节。常量
<constant>CURL_PUST_OK</constant> 和 <constant>CURL_PUSH_DENY</constant> 也已经被添加进来,以便服务器推送的回调函数来表明自己会同意或拒绝处理。
Expand Down
5 changes: 2 additions & 3 deletions appendices/migration71/new-functions.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 5d5a8ef9cbe225d53f1b66b6ae369511d0f6170a Maintainer: jhdxr Status: ready -->
<!-- Reviewed: no -->

<!-- CREDITS: mowangjuanzi -->
<sect1 xml:id="migration71.new-functions">
<title>新的函数</title>

<sect2 xml:id="migration71.new-functions.core">
<title>PHP Core</title>
<title>PHP 核心</title>

<itemizedlist>
<listitem>
Expand Down
30 changes: 11 additions & 19 deletions appendices/migration71/other-changes.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 4360f13f4b1b628dbf700b693bd4eb31627d189f Maintainer: avenger Status: partial -->
<!-- Reviewed: no -->

<!-- CREDITS: mowangjuanzi -->
<sect1 xml:id="migration71.other-changes" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>其它改动</title>
<title>其它变更</title>

<sect2 xml:id="migration71.other-changes.apprise-on-arithmetic-with-invalid-strings">
<title>无效字符串计算的通知和警告</title>
Expand Down Expand Up @@ -134,57 +133,50 @@ string(1) "@"
<term><parameter>precision</parameter></term>
<listitem>
<para>
If the value is set to -1, then the dtoa mode 0 is used. The default
value is still 14.
如果该值设置为 -1,则使用 dtoa mode 0。默认值仍然是 14。
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>serialize_precision</parameter></term>
<listitem>
<para>
If the value is set to -1, then the dtoa mode 0 is used. The value -1 is
now used by default.
如果该值设置为 -1,则使用 dtoa mode 0。现在默认值使用 -1。
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>gd.jpeg_ignore_warning</parameter></term>
<listitem>
<para>
The default of this &php.ini; setting has been changed to 1, so by
default libjpeg warnings are ignored.
&php.ini; 设置的默认值已更改为 1,因此默认情况下将忽略 libjpeg 警告。
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>opcache.enable_cli</parameter></term>
<listitem>
<para>
The default of this &php.ini; setting has been changed to 1
(enabled) in PHP 7.1.2, and back to 0 (disabled) in PHP 7.1.7.
&php.ini; 设置的默认值已在 PHP 7.1.2 中更改为 1(启用),并在 PHP 7.1.7 中更改回 0(禁用)。
</para>
</listitem>
</varlistentry>
</variablelist>
</sect2>

<sect2 xml:id="migration71.other-changes.session-id-csprng-gen">
<title>Session ID generation with a CSPRNG only</title>
<title>仅使用 CSPRNG 生成会话 ID</title>

<para>
Session IDs will now only be generated with a CSPRNG.
现在只能使用 CSPRNG 生成会话 ID。
</para>
</sect2>

<sect2 xml:id="migration71.other-changes.typeerror-error-messages">
<title>More informative <classname>TypeError</classname> messages when &null; is allowed</title>
<title>当允许 null 时提供更多信息的 <classname>TypeError</classname> 消息</title>
<para>
<classname>TypeError</classname> exceptions for arg_info type checks will
now provide more informative error messages. If the parameter type or return
type accepts &null; (by either having a default value of &null; or being a
nullable type), then the error message will now mention this with a message
of "must be ... or null" or "must ... or be null."
arg_info 类型检查的 <classname>TypeError</classname> 异常现在将提供更多有用的错误消息。如果参数类型或返回类型接受
&null;(通过具有默认值 &null; 或可为 &null; 的类型),则错误消息现在将通过消息“must be ... or null”或“must ... or be null.”提及这一点。
</para>
</sect2>
</sect1>
Expand Down
Loading

0 comments on commit 87e3085

Please sign in to comment.