A simple &
to save your life:
class Common{
static public function is_empty(&$val,$IfEmptyThenReturnValue){
if(empty($val)){
return $IfEmptyThenReturnValue;
}else{
return $val;
}
}
}
echo Common::is_empty($d,"null");