<?php
// Fetches the value of $_GET['user'] and returns 'nobody'
// if it does not exist.
$username = $_GET['user'] ?? 'nobody';
// This is equivalent to:
$username = isset($_GET['user']) ? $_GET['user'] : 'nobody';
// Coalesces can be chained: this will return the first
// defined value out of $_GET['user'], $_POST['user'], and
// 'nobody'.
$username = $_GET['user'] ?? $_POST['user'] ?? 'nobody';
?>
array_sum() -对数组中所有值求和 array_map() -为数组的每个元素应用回调函数range(1,5) -建立从1到5的一维数组null合并运算符 (??)<?php// Fetches the value of $_GET['user'] and returns 'nobody'// if it does not exist.$username = $_GET['u