- define: documentation ( source)
<?php
define('VOID', INF);
function ifsetter(&$mElement, $mDefault = '') {
if (!isset($mElement) OR $mElement === VOID){
$mElement = $mDefault;
}
return $mElement;
}
$t = [];
echo ifsetter($t['aaa'], 'hello'); // return 'hello' and set $t['aaa'] = 'hello';