默认值

数组和集合 / 字典

<?php

//PHP 中没有 Dictionary 类型,改用数组
$dic1 = [1 => "one"];

$strValue = $dic1[2];
//strValue is null

$dic2 = ["one" => 1];

$intValue = $dic2["two"];
//intValue is null

echo "strValue = ", is_null($strValue), "\n";
echo "intValue = ", is_null($intValue), "\n";