男女疯狂一边摸一边做羞羞视频|啊好深好硬快点用力别停动态图|亚洲一区无码中文字幕|特级无码毛片免费视频播放▽|久久狠狠躁免费观看|国内精品久久久久久网站

PHP 8.0 廢棄的功能

PHP 核心中廢棄的功能

  • 如果帶有默認值的參數后面跟著(zhù)一個(gè)必要的參數,那么默認值就會(huì )無(wú)效。這在 PHP 8.0.0 中已被廢棄,通??梢酝ㄟ^(guò)刪除默認值,不影響現有功能:

    <?php
    function test($a = [], $b) {} // 之前
    function test($a$b) {}      // 之后
    ?>

    這條規則的一個(gè)例外是 Type $param = null 形式的參數,其中 null 的默認值使得類(lèi)型隱式為空。這種用法仍然是允許的,但仍建議使用顯式可空類(lèi)型。

    <?php
    function test(A $a null$b) {} // 舊寫(xiě)法,仍可用
    function test(?A $a$b) {}       // 推薦寫(xiě)法
    ?>

  • 參數 exclude_disabled 不能設置為 false 來(lái)調用 get_defined_functions(),該參數已被廢棄,不再起作用。 get_defined_functions() 絕不會(huì )再包含禁用的函數。

Enchant

LibXML

libxml_disable_entity_loader() has been deprecated. As libxml 2.9.0 is now required, external entity loading is guaranteed to be disabled by default, and this function is no longer needed to protect against XXE attacks, unless the (still vulnerable). LIBXML_NOENT is used. In that case, it is recommended to refactor the code using libxml_set_external_entity_loader() to suppress loading of external entities.

PGSQL / PDO PGSQL

Standard Library

  • Sort comparison functions that return true or false will now throw a deprecation warning, and should be replaced with an implementation that returns an integer less than, equal to, or greater than zero.

    <?php
    // Replace
    usort($arrayfn($a$b) => $a $b);
    // With
    usort($arrayfn($a$b) => $a <=> $b);
    ?>

Zip

  • Using an empty file as ZipArchive is deprecated. Libzip 1.6.0 does not accept empty files as valid zip archives any longer. The existing workaround will be removed in the next version.

  • The procedural API of Zip is deprecated. Use ZipArchive instead. Iteration over all entries can be accomplished using ZipArchive::statIndex() and a for loop:

    <?php
    // iterate using the procedural API
    assert(is_resource($zip));
    while (
    $entry zip_read($zip)) {
        echo 
    zip_entry_name($entry);
    }

    // iterate using the object-oriented API
    assert($zip instanceof ZipArchive);
    for (
    $i 0$entry $zip->statIndex($i); $i++) {
        echo 
    $entry['name'];
    }
    ?>

Reflection

男女疯狂一边摸一边做羞羞视频|啊好深好硬快点用力别停动态图|亚洲一区无码中文字幕|特级无码毛片免费视频播放▽|久久狠狠躁免费观看|国内精品久久久久久网站