Migration56/changed-functions-Phpdoc专题

函数的变化

PHP 内核

  • 如果省略 salt 参数,<span class="function">crypt 会产生 E_NOTICE错误。
  • substr_comparelength 参数现在接受 0 的值。
  • unserialize will now fail if passed serialised data that has been manipulated to attempt to instantiate an object without calling its constructor.

cURL

  • 只有设置 CURLOPT_SAFE_UPLOADfalse 的情况下, 才接受 @file 语法上传文件。 最好使用 <span class="classname">CURLFile 代替。

Mcrypt

  • <span class="function">mcrypt_create_ivsource 现在默认值是 MCRYPT_DEV_URANDOM,而非 MCRYPT_DEV_RANDOM

OpenSSL

  • 如果 SSL 上下文选项已经提供 crypto_type 选项, stream_socket_enable_crypto 可以忽略 crypto_type 参数。

PostgreSQL

  • <span class="function">pg_insert、<span class="function">pg_select、 <span class="function">pg_update、<span class="function">pg_delete 不再是实验性质的。
  • 如果数据库连接 socket 流设置为非阻塞(non-blocking)模式, <span class="function">pg_send_execute、 <span class="function">pg_send_prepare、<span class="function">pg_send_query 、<span class="function">pg_send_query_params 不再会阻塞查询直到写入完成。

Reflection

  • <span class="methodname">ReflectionClass::newInstanceWithoutConstructor 现在允许非 Final 的内部类实例化。

XMLReader

  • 和 <span class="methodname">XMLReader::getAttribute 一样,未找到属性的情况下, <span class="methodname">XMLReader::getAttributeNs 和 <span class="methodname">XMLReader::getAttributeNo 会返回 null

本站为非盈利网站,作品由网友提供上传,如无意中有侵犯您的版权,请联系删除