diff --git a/reference/curl/functions/curl-upkeep.xml b/reference/curl/functions/curl-upkeep.xml
new file mode 100644
index 000000000..92a8e4b1a
--- /dev/null
+++ b/reference/curl/functions/curl-upkeep.xml
@@ -0,0 +1,101 @@
+
+
+
+
+ curl_upkeep
+ 执行连接保活检查
+
+
+
+ &reftitle.description;
+
+ boolcurl_upkeep
+ CurlHandlehandle
+
+
+ 需要使用 libcurl >= 7.62.0 构建才可用。
+
+
+ 某些协议具有"连接保活"机制。
+ 这些机制通常会在现有连接上发送少量流量以保持连接活跃;
+ 例如,这可以防止连接被过于严格的防火墙关闭。
+
+
+ 连接保活目前仅适用于 HTTP/2 连接。
+ 通常会发送少量流量来保持连接活跃。
+ HTTP/2 通过发送 HTTP/2 PING 帧来维持其连接。
+
+
+
+
+ &reftitle.parameters;
+
+
+ &curl.ch.description;
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ &return.success;
+
+
+
+
+ &reftitle.examples;
+
+
+ curl_upkeep 示例
+
+
+]]>
+
+
+
+
+
+
+ &reftitle.seealso;
+
+
+ curl_init
+
+
+
+
+
diff --git a/reference/json/functions/json-decode.xml b/reference/json/functions/json-decode.xml
index e7b997c93..a44d1b559 100644
--- a/reference/json/functions/json-decode.xml
+++ b/reference/json/functions/json-decode.xml
@@ -121,8 +121,8 @@
7.1.0
- An empty JSON key ("") can be encoded to the empty object property
- instead of using a key with value _empty_.
+ 空的 JSON key("")可以被编码为空的对象属性,而不是使用值为
+ _empty_ 的键。
@@ -169,11 +169,10 @@ array(5) {
- Accessing invalid object properties
+ 访问无效的对象属性
- Accessing elements within an object that contain characters not
- permitted under PHP's naming convention (e.g. the hyphen) can be
- accomplished by encapsulating the element name within braces and the apostrophe.
+ 可以通过将元素名称用花括号和单引号括起来,来访问对象中包含 PHP
+ 命名约定不允许的字符(例如连字符)的元素。
{'foo-bar'}; // 12345
- common mistakes using json_decode
+ 使用 json_decode 的常见错误
- depth errors
+ depth 错误
- json_decode of large integers
+ json_decode 处理大整数
- The JSON spec is not JavaScript, but a subset of JavaScript.
+ JSON 规范不是 JavaScript,而是 JavaScript 的一个子集。
- In the event of a failure to decode, json_last_error
- can be used to determine the exact nature of the error.
+ 如果解码失败,可以使用 json_last_error
+ 来确定错误的确切性质。
diff --git a/reference/json/functions/json-last-error.xml b/reference/json/functions/json-last-error.xml
index 568316ff4..6fcc6a7cc 100644
--- a/reference/json/functions/json-last-error.xml
+++ b/reference/json/functions/json-last-error.xml
@@ -1,6 +1,6 @@
-
+
@@ -72,16 +72,16 @@
JSON_ERROR_RECURSION
- One or more recursive references in the value to be encoded
+ 待编码的值中存在一个或多个递归引用
JSON_ERROR_INF_OR_NAN
- One or more
+ 待编码的值中存在一个或多个
NAN
- or INF
- values in the value to be encoded
+ 或 INF
+ 值
@@ -100,6 +100,11 @@
畸形的 UTF-16 字符,可能因为字符编码不正确。
+
+ JSON_ERROR_NON_BACKED_ENUM
+ 值包含无法序列化的非回退枚举。自 PHP 8.1.0 起可用。
+
+
diff --git a/reference/pcre/functions/preg-last-error-msg.xml b/reference/pcre/functions/preg-last-error-msg.xml
new file mode 100644
index 000000000..cf85a8b85
--- /dev/null
+++ b/reference/pcre/functions/preg-last-error-msg.xml
@@ -0,0 +1,90 @@
+
+
+
+
+ preg_last_error_msg
+ 返回最后一个 PCRE 正则表达式执行产生的错误信息
+
+
+
+ &reftitle.description;
+
+ stringpreg_last_error_msg
+
+
+
+ 返回最后一次 PCRE 正则表达式执行产生的错误信息。
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ 成功时返回错误信息,如果没有发生错误则返回 "No error"。
+
+
+
+
+ &reftitle.examples;
+
+
+ preg_last_error_msg 示例
+
+)*[!?]/', 'foobar foobar foobar');
+
+if (preg_last_error() !== PREG_NO_ERROR) {
+ echo preg_last_error_msg();
+}
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+
+ preg_last_error
+
+
+
+
+
+
+
diff --git a/reference/pcre/functions/preg-replace-callback-array.xml b/reference/pcre/functions/preg-replace-callback-array.xml
new file mode 100644
index 000000000..bc2a8a410
--- /dev/null
+++ b/reference/pcre/functions/preg-replace-callback-array.xml
@@ -0,0 +1,186 @@
+
+
+
+
+ preg_replace_callback_array
+ 执行一个正则表达式搜索并使用回调进行替换
+
+
+
+ &reftitle.description;
+
+ stringarraynullpreg_replace_callback_array
+ arraypattern
+ stringarraysubject
+ intlimit-1
+ intcount&null;
+ intflags0
+
+
+ 此函数的行为类似于
+ preg_replace_callback,不同之处在于回调函数是基于每个模式分别执行的。
+
+
+
+
+ &reftitle.parameters;
+
+
+
+ pattern
+
+
+ 一个关联数组,将模式(键)映射到 callable(值)。
+
+
+
+
+ subject
+
+
+ 要搜索替换的目标字符串或字符串数组。
+
+
+
+
+ limit
+
+
+ 对于每个模式用于每个 subject 字符串的最大可替换次数。
+ 默认是 -1(无限制)。
+
+
+
+
+ count
+
+
+ 如果指定,这个变量将被填充为替换执行的次数。
+
+
+
+
+ flags
+
+
+ flags 可以是 PREG_OFFSET_CAPTURE
+ 和 PREG_UNMATCHED_AS_NULL 标志的组合,这会影响匹配到的结果的格式。
+ 相关详情请参阅 preg_match 中的描述。
+
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ 如果 subject 是一个数组,
+ preg_replace_callback_array 返回一个数组,其他情况返回字符串。错误发生时返回 &null;。
+
+
+ 如果查找到了匹配,返回替换后的目标字符串,其他情况
+ subject 将会无变化返回。
+
+
+
+
+ &reftitle.errors;
+ &pcre.pattern.warning;
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ 7.4.0
+
+ 新增 flags 参数。
+
+
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+
+ preg_replace_callback_array 示例
+
+ function ($match) {
+ echo strlen($match[0]), ' matches for "a" found', PHP_EOL;
+ },
+ '~[b]+~i' => function ($match) {
+ echo strlen($match[0]), ' matches for "b" found', PHP_EOL;
+ }
+ ],
+ $subject
+);
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+
+ PCRE 模式
+ preg_replace_callback
+ preg_quote
+ preg_replace
+ preg_last_error
+ 匿名函数
+
+
+
+
+
+
diff --git a/reference/pdo/pdo/connect.xml b/reference/pdo/pdo/connect.xml
new file mode 100644
index 000000000..382a473bd
--- /dev/null
+++ b/reference/pdo/pdo/connect.xml
@@ -0,0 +1,73 @@
+
+
+
+
+ PDO::connect
+ 连接到数据库,如果驱动支持则返回 PDO 子类实例
+
+
+
+ &reftitle.description;
+
+ public static staticPDO::connect
+ stringdsn
+ stringnullusername&null;
+ #[\SensitiveParameter]stringnullpassword&null;
+ arraynulloptions&null;
+
+
+ 如果所连接的数据库存在对应的 PDO 子类,
+ 则创建该子类的实例,否则返回通用的 PDO 实例。
+
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ 如果对应的 PDO 驱动存在子类,则返回该 PDO
+ 子类的实例,否则返回通用的 PDO 实例。
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ Pdo\Dblib
+ Pdo\Firebird
+ Pdo\Mysql
+ Pdo\Odbc
+ Pdo\Pgsql
+ Pdo\Sqlite
+ PDO::__construct
+
+
+
+
+
diff --git a/reference/pdo/pdo/errorinfo.xml b/reference/pdo/pdo/errorinfo.xml
new file mode 100644
index 000000000..2fbbbd957
--- /dev/null
+++ b/reference/pdo/pdo/errorinfo.xml
@@ -0,0 +1,135 @@
+
+
+
+
+
+ PDO::errorInfo
+
+ 获取与数据库句柄上最后一次操作相关的扩展错误信息
+
+
+
+ &reftitle.description;
+
+ public arrayPDO::errorInfo
+
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ PDO::errorInfo 返回一个包含此数据库句柄上最后一次操作的错误信息的数组。该数组至少包含以下字段:
+
+
+
+
+ 元素
+ 信息
+
+
+
+
+ 0
+ SQLSTATE 错误码(由 ANSI SQL 标准定义的五个字符的字母数字标识符)。
+
+
+ 1
+ 驱动程序特定的错误码。
+
+
+ 2
+ 驱动程序特定的错误信息。
+
+
+
+
+
+
+
+
+ 如果没有设置 SQLSTATE 错误码或驱动程序没有报告特定错误,则元素 0 之后的元素将被设置为 &null;。
+
+
+
+
+ PDO::errorInfo 仅获取直接在数据库句柄上执行的操作的错误信息。如果通过
+ PDO::prepare 或
+ PDO::query 创建 PDOStatement 对象,并在语句句柄上产生错误,PDO::errorInfo
+ 将不会反映语句句柄上的错误。必须调用
+ PDOStatement::errorInfo
+ 来返回在特定语句句柄上执行的操作的错误信息。
+
+
+
+
+ &reftitle.examples;
+
+ 显示连接到 DB2 数据库的 PDO_ODBC 的 errorInfo() 字段
+
+prepare('bogus sql');
+if (!$stmt) {
+ echo "\nPDO::errorInfo():\n";
+ print_r($dbh->errorInfo());
+}
+?>
+]]>
+
+ &example.outputs;
+
+ HY000
+ [1] => 1
+ [2] => near "bogus": syntax error
+)
+]]>
+
+
+
+
+
+
+ &reftitle.seealso;
+
+
+ PDO::errorCode
+ PDOStatement::errorCode
+ PDOStatement::errorInfo
+
+
+
+
+
+
+
diff --git a/reference/pdo/pdostatement/getiterator.xml b/reference/pdo/pdostatement/getiterator.xml
new file mode 100644
index 000000000..7192ceb33
--- /dev/null
+++ b/reference/pdo/pdostatement/getiterator.xml
@@ -0,0 +1,56 @@
+
+
+
+
+ PDOStatement::getIterator
+ 获取结果集迭代器
+
+
+
+ &reftitle.description;
+
+ public IteratorPDOStatement::getIterator
+
+
+
+
+
+
+ &warn.undocumented.func;
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+
+
+
+
+
+
+
diff --git a/reference/pdo/prepared-statements.xml b/reference/pdo/prepared-statements.xml
index feb5aa13a..6382aabe2 100644
--- a/reference/pdo/prepared-statements.xml
+++ b/reference/pdo/prepared-statements.xml
@@ -98,7 +98,7 @@ foreach ($stmt as $row) {
- Calling a stored procedure with an output parameter
+ 调用一个带有输出参数的存储过程
如果数据库驱动支持,应用程序还可以绑定输出和输入参数。
输出参数通常用于从存储过程获取值。
diff --git a/reference/session/functions/session-create-id.xml b/reference/session/functions/session-create-id.xml
new file mode 100644
index 000000000..649cba061
--- /dev/null
+++ b/reference/session/functions/session-create-id.xml
@@ -0,0 +1,149 @@
+
+
+
+
+
+ session_create_id
+ 创建新的会话 ID
+
+
+ &reftitle.description;
+
+ stringfalsesession_create_id
+ stringprefix""
+
+
+ session_create_id 用于为当前会话创建新的会话
+ ID。它返回无冲突的会话 ID。
+
+
+ 如果会话未处于活动状态,则会省略冲突检查。
+
+
+ 会话 ID 根据 php.ini 的设置来创建。
+
+
+ 重要的是,GC 任务脚本需要使用与 Web 服务器相同的用户 ID。
+ 否则,可能会遇到权限问题,尤其是在使用文件保存处理程序时。
+
+
+
+
+ &reftitle.parameters;
+
+
+
+ prefix
+
+
+ 如果指定了 prefix,新的会话 ID
+ 将以 prefix 作为前缀。会话 ID
+ 中并非所有字符都被允许。允许的字符范围为
+ [a-zA-Z0-9,-]。最大长度为 256 个字符。
+
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ session_create_id 返回当前会话的新的无冲突会话
+ ID。如果在没有活动会话的情况下使用,则会省略冲突检查。
+ 失败时返回 &false;。
+
+
+
+
+ &reftitle.examples;
+
+
+ session_create_id 与 session_regenerate_id 的使用示例
+
+
+]]>
+
+
+
+
+
+
+ &reftitle.seealso;
+
+
+ session_regenerate_id
+ session_start
+ session.use_strict_mode
+ SessionHandler::create_sid
+
+
+
+
+