- var_dump: documentation ( source)
- array_filter: documentation ( source)
<?php
function atLeastTwoNotNull() {
return count(array_filter(func_get_args(), function($arg) { return !is_null($arg); } )) >= 2;
}
$a = null;
$b = true;
$c = false;
$d = null;
$e = null;
var_dump(atLeastTwoNotNull($a, $b, $c, $d, $e));