Taken from PHP official manual:
NULL can be used as default value, but it can not be passed from outside
<?php
function foo(&$a = NULL) {
if ($a === NULL) {
echo "NULL
";
} else {
echo "$a
";
}
}
foo(); // "NULL"
foo($uninitialized_var); // "NULL"
$var = "hello world";
foo($var); // "hello world"
foo(5); // Produces an error
foo(NULL); // Produces an error
?>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…