Skip to content

Commit 115b573

Browse files
authored
Sync types and fix commit id error (#997)
1 parent bcfb2b6 commit 115b573

File tree

12 files changed

+38
-31
lines changed

12 files changed

+38
-31
lines changed

language/types/array.xml

Lines changed: 10 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: e587d0655e426f97b3fcb431453da5030e743b23 Maintainer: HonestQiao Status: ready -->
3+
<!-- EN-Revision: 094816bd170e26abf0e057dae1cfb498dd6aad88 Maintainer: HonestQiao Status: ready -->
44
<!-- CREDITS: Geogory, dallas, jwj, mowangjuanzi, Luffy -->
55
<sect1 xml:id="language.types.array">
66
<title>Array 数组</title>
@@ -701,6 +701,11 @@ echo $b, PHP_EOL; // 打印 1
701701
级别的错误消息(PHP 8.0.0 之前是 <constant>E_NOTICE</constant> 级别),结果将是 &null;
702702
</para>
703703
</note>
704+
<note>
705+
<para>
706+
解构标量值会分配 &null; 到所有变量。
707+
</para>
708+
</note>
704709
</sect3>
705710

706711
</sect2><!-- end syntax -->
@@ -861,12 +866,12 @@ $arr = array('fruit' => 'apple', 'veggie' => 'carrot');
861866
echo $arr['fruit'], PHP_EOL; // apple
862867
echo $arr['veggie'], PHP_EOL; // carrot
863868
864-
// Incorrect. This works but also throws a PHP Error because
869+
// Incorrect. This does not work and throws a PHP Error because
865870
// of an undefined constant named fruit
866871
//
867872
// Error: Undefined constant "fruit"
868873
try {
869-
echo $arr[fruit]; // apple
874+
echo $arr[fruit];
870875
} catch (Error $e) {
871876
echo get_class($e), ': ', $e->getMessage(), PHP_EOL;
872877
}
@@ -880,7 +885,7 @@ echo $arr['fruit'], PHP_EOL; // apple
880885
echo $arr[fruit], PHP_EOL; // carrot
881886
882887
// The following is okay, as it's inside a string. Constants are not looked for
883-
// within strings, so no E_NOTICE occurs here
888+
// within strings, so no error occurs here
884889
echo "Hello $arr[fruit]", PHP_EOL; // Hello apple
885890
886891
// With one exception: braces surrounding arrays within strings allows constants
@@ -908,14 +913,6 @@ print "Hello $_GET['foo']";
908913
</programlisting>
909914
</informalexample>
910915

911-
<para>
912-
当打开 <link linkend="ini.error-reporting">error_reporting</link> 来显示
913-
<constant>E_NOTICE</constant> 级别的错误(将其设为
914-
<constant>E_ALL</constant>)时将看到这些错误。默认情况下
915-
<link linkend="ini.error-reporting">error_reporting</link>
916-
被关闭不显示这些。
917-
</para>
918-
919916
<para>
920917
和在 <link linkend="language.types.array.syntax">语法</link>
921918
一节中规定的一样,在方括号(<literal>[</literal>” 和
@@ -1106,7 +1103,7 @@ array(3) {
11061103
<para>
11071104
在 array 定义时,用 <code>...</code> 前缀的一个 array 可以被展开到当前位置。
11081105
只有实现了 <interfacename>Traversable</interfacename> 的数组和对象才能被展开。
1109-
PHP 7.4.0 开始可以使用 <code>...</code> 解包 array。
1106+
PHP 7.4.0 开始可以使用 <code>...</code> 解包 array。这也被称之为展开运算符。
11101107
</para>
11111108

11121109
<para>

language/types/boolean.xml

Lines changed: 4 additions & 1 deletion
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: e587d0655e426f97b3fcb431453da5030e743b23 Maintainer: Avenger Status: ready -->
3+
<!-- EN-Revision: f90b26b377a61c76c0f64028e47553e550411d08 Maintainer: Avenger Status: ready -->
44
<!-- CREDITS: dallas, Altair, mowangjuanzi, Luffy -->
55
<sect1 xml:id="language.types.boolean">
66
<title>Boolean 布尔类型</title>
@@ -35,6 +35,9 @@ $foo = True; // 设置 $foo 为 TRUE
3535
<programlisting role="php">
3636
<![CDATA[
3737
<?php
38+
$action = "show_version";
39+
$show_separators = true;
40+
3841
// == 是一个操作符,它检测两个变量是否相等,并返回一个布尔值
3942
if ($action == "show_version") {
4043
echo "The version is 1.23";

language/types/callable.xml

Lines changed: 7 additions & 4 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: e587d0655e426f97b3fcb431453da5030e743b23 Maintainer: dallas Status: ready -->
3+
<!-- EN-Revision: eac9eff7b66d8c2b168c25c72de0422126daf8cb Maintainer: dallas Status: ready -->
44
<!-- CREDITS: Luffy -->
55
<sect1 xml:id="language.types.callable">
66
<title>Callback / Callable 类型</title>
@@ -18,8 +18,11 @@
1818
<title>传递</title>
1919

2020
<para>
21-
PHP是将函数以<type>string</type>形式传递的。
22-
可以使用任何内置或用户自定义函数,但除了语言结构例如:<function>array</function>,<function>echo</function>,<function>empty</function>,<function>eval</function>,<function>exit</function>,<function>isset</function>,<function>list</function>,<function>print</function>
21+
PHP是将函数以 <type>string</type> 形式传递或通过 <link linkend="functions.first_class_callable_syntax">first-class callable</link>。
22+
可以使用任何内置或用户自定义函数,但除了语言结构例如:<function>array</function>,<function>echo</function>,
23+
<function>empty</function>,<function>eval</function>,
24+
<function>exit</function>,<function>isset</function>,
25+
<function>list</function>,<function>print</function>
2326
或 <function>unset</function>。
2427
</para>
2528

@@ -111,7 +114,7 @@ call_user_func($c, 'PHP!');
111114
</para>
112115
<para>
113116
<example>
114-
<title>使用 Closure 的示例</title>
117+
<title>使用 <classname>Closure</classname> 的示例</title>
115118
<programlisting role="php">
116119
<![CDATA[
117120
<?php

language/types/declarations.xml

Lines changed: 2 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: e587d0655e426f97b3fcb431453da5030e743b23 Maintainer: avenger Status: ready -->
3+
<!-- EN-Revision: 0ece873cecfc4dacd14e8bebbec12c6e00de56a0 Maintainer: avenger Status: ready -->
44
<!-- CREDITS: mowangjuanzi, Luffy -->
55
<sect1 xml:id="language.types.declarations">
66
<title>类型声明</title>
@@ -334,7 +334,7 @@ NULL
334334
</listitem>
335335
<listitem>
336336
<simpara>
337-
使用 <type>mixed</type> 会导致错误。
337+
使用 <type>mixed</type> 或 <type>never</type> 会导致错误。
338338
</simpara>
339339
</listitem>
340340
<listitem>

language/types/type-juggling.xml

Lines changed: 2 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: e587d0655e426f97b3fcb431453da5030e743b23 Maintainer: Avenger Status: ready -->
3+
<!-- EN-Revision: 3a97501ec4b56ed700facd0163d11faadc58663d Maintainer: Avenger Status: ready -->
44
<!-- CREDITS: Geogory, dallas, Altair, mowangjuanzi, Luffy -->
55
<sect1 xml:id="language.types.type-juggling">
66
<title>类型转换</title>
@@ -288,7 +288,7 @@ var_dump($bar);
288288

289289
<warning>
290290
<simpara>
291-
自 PHP 8.0.0 起弃用 <literal>(real)</literal> 转换别名。
291+
自 PHP 7.4.0 起弃用 <literal>(real)</literal> 转换别名,并在 PHP 8.0.0 中移除
292292
</simpara>
293293
</warning>
294294

reference/pdo/configure.xml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: b3d09b7bb4513a6fc08c9adf8793929cb283acc6 Maintainer: ichenshy Status: ready -->
4-
<!-- CREDITS: mowangjuanzi -->
3+
<!-- EN-Revision: f90b26b377a61c76c0f64028e47553e550411d08 Maintainer: ichenshy Status: ready -->
4+
<!-- CREDITS: mowangjuanzi, Luffy -->
55
<section xml:id="pdo.installation" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
66
&reftitle.install;
7+
<para>
8+
&installation.enabled.disable;
9+
<option role="configure">--disable-pdo</option>
10+
</para>
711
<procedure xml:id="pdo.install.unix51up">
8-
<title>在 Unix 系统上安装 PDO </title>
12+
<title>在 Unix 系统上安装 PDO</title>
913
<step>
1014
<para>
1115
PDO 和 <link linkend="ref.pdo-sqlite">PDO_SQLITE</link> 驱动默认可用。对所选的数据库应启用相应的 POD 驱动;查阅<link

reference/xml/examples.xml

Lines changed: 1 addition & 1 deletion
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: 00a8ae0c879a70f4bc96a707212482f0fcbd9ac6 Maintainer: Luffy Status: ready -->
3+
<!-- EN-Revision: f90b26b377a61c76c0f64028e47553e550411d08 Maintainer: Luffy Status: ready -->
44
<chapter xml:id="xml.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
55
&reftitle.examples;
66
<section xml:id="example.xml-structure">

reference/xml/functions/xml-parse-into-struct.xml

Lines changed: 1 addition & 1 deletion
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: 00a8ae0c879a70f4bc96a707212482f0fcbd9ac6 Maintainer: class007 Status: ready -->
3+
<!-- EN-Revision: f90b26b377a61c76c0f64028e47553e550411d08 Maintainer: class007 Status: ready -->
44
<!-- CREDITS: mowangjuanzi, Luffy -->
55
<refentry xml:id="function.xml-parse-into-struct" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>

reference/xml/functions/xml-parse.xml

Lines changed: 1 addition & 1 deletion
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: 00a8ae0c879a70f4bc96a707212482f0fcbd9ac6 Maintainer: HonestQiao Status: ready -->
3+
<!-- EN-Revision: f90b26b377a61c76c0f64028e47553e550411d08 Maintainer: HonestQiao Status: ready -->
44
<!-- CREDITS: mowangjuanzi, Luffy -->
55
<refentry xml:id="function.xml-parse" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>

reference/xml/functions/xml-parser-create-ns.xml

Lines changed: 1 addition & 1 deletion
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: 00a8ae0c879a70f4bc96a707212482f0fcbd9ac6 Maintainer: class007 Status: ready -->
3+
<!-- EN-Revision: f90b26b377a61c76c0f64028e47553e550411d08 Maintainer: class007 Status: ready -->
44
<!-- CREDITS: mowangjuanzi, Luffy -->
55
<refentry xml:id="function.xml-parser-create-ns" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>

0 commit comments

Comments
 (0)