首頁  >  文章  >  後端開發  >  介紹PHP7的一些特性用法

介紹PHP7的一些特性用法

coldplay.xixi
coldplay.xixi轉載
2020-09-11 17:36:242542瀏覽

介紹PHP7的一些特性用法

相關學習推薦:php程式設計(影片)

    1.use的用法

    2.序號函數unserialize的新增了過濾功能

// 转换对象为 __PHP_Incomplete_Class 对象
$data = unserialize($foo, ["allowed_classes" => false]);

// 转换对象为 __PHP_Incomplete_Class 对象,除了 MyClass 和 MyClass2
$data = unserialize($foo, ["allowed_classes" => ["MyClass", "MyClass2"]);

// 默认接受所有类
$data = unserialize($foo, ["allowed_classes" => true]);

    3.透過define定義常數數組

    4.三目運算子null合併

想了解更多程式設計學習,請關注php培訓欄位!

#

以上是介紹PHP7的一些特性用法的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:phpxs.com。如有侵權,請聯絡admin@php.cn刪除