Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34942 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3057 invoked by uid 1010); 26 Jan 2008 18:18:02 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 3042 invoked from network); 26 Jan 2008 18:18:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jan 2008 18:18:02 -0000 Authentication-Results: pb1.pair.com smtp.mail=email@fuer-et.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=email@fuer-et.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fuer-et.de from 62.75.137.136 cause and error) X-PHP-List-Original-Sender: email@fuer-et.de X-Host-Fingerprint: 62.75.137.136 fuer-et.de Linux 2.5 (sometimes 2.4) (4) Received: from [62.75.137.136] ([62.75.137.136:36700] helo=eve.fuer-et.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9D/D0-08850-8597B974 for ; Sat, 26 Jan 2008 13:18:01 -0500 Received: from edea.local (p4FC84C44.dip.t-dialin.net [79.200.76.68]) by eve.fuer-et.de (Postfix) with ESMTP id 16CF71C59BE8 for ; Sat, 26 Jan 2008 18:17:58 +0000 (UTC) To: internals@lists.php.net Date: Sat, 26 Jan 2008 19:17:52 +0100 User-Agent: KMail/1.9.7 References: <1201368129.8418.8.camel@sams-room> In-Reply-To: <1201368129.8418.8.camel@sams-room> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <200801261917.52382.email@fuer-et.de> Subject: Re: [PHP-DEV] ifsetor like expression in php6 From: email@fuer-et.de (Stefan Walk) On Saturday 26 January 2008 18:22:09 Sam Barrow wrote: > I'm sorry I misunderstood. If specifying like "$var ?: 5" then it should > throw an E_NOTICE, as this is a conditional that checks the value of a > variable ($var). > > Sebastian, for assigning of a default value is a variable is not set, I > would recommend using something like this (this is what I use): > > function ifsetor(&$var, $or) { > return isset($var) ? $var : $or ; > } That magically brings $foo into life if you do ifsetor($foo, 2).