Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26466 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87740 invoked by uid 1010); 10 Nov 2006 14:34:09 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 87724 invoked from network); 10 Nov 2006 14:34:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Nov 2006 14:34:09 -0000 Authentication-Results: pb1.pair.com header.from=tularis@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=tularis@php.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain php.net from 195.121.247.24 cause and error) X-PHP-List-Original-Sender: tularis@php.net X-Host-Fingerprint: 195.121.247.24 psmtp12.wxs.nl NetCache Data OnTap 5.x Received: from [195.121.247.24] ([195.121.247.24:36245] helo=psmtp12.wxs.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/37-37447-FDD84554 for ; Fri, 10 Nov 2006 09:34:08 -0500 Received: from [192.168.1.2] (ip3e830243.speed.planet.nl [62.131.2.67]) by psmtp12.wxs.nl (iPlanet Messaging Server 5.2 HotFix 2.07 (built Jun 24 2005)) with ESMTP id <0J8I006H3R442U@psmtp12.wxs.nl> for internals@lists.php.net; Fri, 10 Nov 2006 15:33:41 +0100 (MET) Date: Fri, 10 Nov 2006 15:34:03 +0100 In-reply-to: <45547DF7.8080805@adaniels.nl> To: Arnold Daniels Cc: internals@lists.php.net Message-ID: <45548DDB.8080507@php.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) References: <45547DF7.8080805@adaniels.nl> Subject: Re: Yet another feature request From: tularis@php.net ("M.Sokolewicz") read the archives, there's been a LOT of discussion about this already. AFAIK the team decided not to implement this before PHP 6.0. - tul Arnold Daniels wrote: > Hi, > > I see this is the time to do language feature request. So let me add > another. I very often use something like: > /$a = isset($x['abc']) ? //$x['abc'] : null; > /This is to prevent an E_NOTICE from being thrown. > > This subject is already discussed many times, which led to a suggestion > for PHP6 > (http://www.php.net/~derick/meeting-notes.html#ifsetor-as-replacement-for-foo-isset-foo-foo-something-else) > > /$foo = $_GET['foo'] ?: 42;/ > This still throws an E_NOTICE when the first parameter is not set. Also > $foo will be set to 42 if the input variable is 0. The conclusion is > that this feature is useless for the presented situation. > > I would like something similar to isset: ifsetor($var, [$default = null]); > /$a = ifsetor($x['abc']); > //$foo = ifsetor($_GET['foo'], 42); > / > I believe adding this feature will remove the biggest con people have on > working with E_NOTICE enabled. I'm sorry if I reopen an already closed > subject. > > Best regards, > Arnold >