To define Array constants we used define() In PHP 7.In PHP 5.6, they could only be defined with const.
<?php //define a array using define in PHP 7 define('web', [ 'js', 'json', 'ajax' ]); print(web); ?>
The above example will output: json
session_start() is Old function of PHP.But from PHP 7 session_start() function accepts an array of options.
Anonymous Classes is added in PHP 7.Anonymous classes are defined without any name.we can define an anonymous class using keyword "new class".
Scalar type declarations has been introduced in PHP 7. Scalar type declaration has following two option.