Ron Korving wrote: >> function ifsetor(&$var, $default = null) { >> return isset($var) ? $var : $default; >> } >> >> echo ifsetor($a, 'foo'); >> echo $a, $b; >> echo ifsetor($a, 'foo'); >> echo isset($a) ? 'is set' : 'not set'; >> >> expected result: >> >> foo >> Notice: Undefined variable: a in [...] >> Notice: Undefined variable: b in [...] >> foo >> not set >> >> actual result: >> >> foo >> Notice: Undefined variable: b in [...] >> foo >> not set > > No, ifsetor() is not possible in user land, because it generates notices, > and a php core function ifsetor() would not generate notices. That's really > the way it has to be.
i see no notice produced by this ifsetor() -- Sebastian Mendel www.sebastianmendel.de www.sf.net/projects/phpdatetime | www.sf.net/projects/phptimesheet -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php