Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:16672 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62279 invoked by uid 1010); 14 Jun 2005 14:02:41 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 62264 invoked from network); 14 Jun 2005 14:02:40 -0000 Received: from unknown (HELO xit.nl) (127.0.0.1) by localhost with SMTP; 14 Jun 2005 14:02:40 -0000 X-Host-Fingerprint: 212.238.144.71 korving.demon.nl Received: from ([212.238.144.71:22680] helo=localhost.localdomain) by pb1.pair.com (ecelerity 1.2 r(5656M)) with SMTP id 74/C6-20931-083EEA24 for ; Tue, 14 Jun 2005 10:02:40 -0400 Message-ID: <74.C6.20931.083EEA24@pb1.pair.com> To: internals@lists.php.net 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> <49.34.20931.46FDEA24@pb1.pair.com> Date: Tue, 14 Jun 2005 15:57:20 +0200 Lines: 51 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Posted-By: 212.238.144.71 Subject: Re: [PHP-DEV] PHP 5.1 From: r.korving@xit.nl ("Ron Korving") Hmm, you're right.. so the reference "&" already takes care of this... Well, then I don't see the point of the whole ifsetor() discussions... people can implement this themselves. Ron "Sebastian Mendel" wrote in message news:49.34.20931.46FDEA24@pb1.pair.com... > 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