Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:16666 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47308 invoked by uid 1010); 14 Jun 2005 13:45:09 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 47293 invoked from network); 14 Jun 2005 13:45:09 -0000 Received: from unknown (HELO sebastianmendel.de) (127.0.0.1) by localhost with SMTP; 14 Jun 2005 13:45:09 -0000 X-Host-Fingerprint: 84.148.167.184 p5494A7B8.dip0.t-ipconnect.de Received: from ([84.148.167.184:5024] helo=localhost.localdomain) by pb1.pair.com (ecelerity 1.2 r(5656M)) with SMTP id 49/34-20931-46FDEA24 for ; Tue, 14 Jun 2005 09:45:08 -0400 Message-ID: <49.34.20931.46FDEA24@pb1.pair.com> To: internals@lists.php.net Date: Tue, 14 Jun 2005 15:54:43 +0200 User-Agent: Mozilla Thunderbird 1.0+ (Windows/20050602) MIME-Version: 1.0 References: <5.1.0.14.2.20050603203711.028e9140@localhost><200506051859.53976.magnus@php.net> <6E.27.21296.C90E7A24@pb1.pair.com><38.CE.21296.BFD78A24@pb1.pair.com> <43.34.20931.17BEDA24@pb1.pair.com> <177634065.20050613225603@artweb-design.de> <9D.D2.20931.D8DDEA24@pb1.pair.com> In-Reply-To: <9D.D2.20931.D8DDEA24@pb1.pair.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Posted-By: 84.148.167.184 Subject: Re: [PHP-DEV] PHP 5.1 From: lists@sebastianmendel.de (Sebastian Mendel) 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