Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66540 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54860 invoked from network); 7 Mar 2013 20:07:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Mar 2013 20:07:00 -0000 Authentication-Results: pb1.pair.com header.from=wfitch@meetme.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=wfitch@meetme.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain meetme.com designates 74.125.149.73 as permitted sender) X-PHP-List-Original-Sender: wfitch@meetme.com X-Host-Fingerprint: 74.125.149.73 na3sys009aog104.obsmtp.com Linux 2.5 (sometimes 2.4) (4) Received: from [74.125.149.73] ([74.125.149.73:36492] helo=na3sys009aog104.obsmtp.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 54/F9-31723-263F8315 for ; Thu, 07 Mar 2013 15:06:59 -0500 Received: from mail-qa0-f70.google.com ([209.85.216.70]) (using TLSv1) by na3sys009aob104.postini.com ([74.125.148.12]) with SMTP ID DSNKUTjzYOGE0Y5PPXhazaa0Pdq8dfsrkXhK@postini.com; Thu, 07 Mar 2013 12:06:59 PST Received: by mail-qa0-f70.google.com with SMTP id bs12so1529782qab.9 for ; Thu, 07 Mar 2013 12:06:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-received:sender:in-reply-to:references :date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:x-gm-message-state; bh=qHsIW1m/36r4P7ewtdOQKUNDr5/V/kuZ4WDg3M3zRYI=; b=h0h8F1s0JbOaGiEdl88SY0fgnOUFf8AM+UtlLtkCtoA5072HtyWR41Si4/QPidEBYw Iv5h5KfPYs1uAnpa6gn3SYdYtZVjxMXbUnhhyy7pgkN9JUnNXFbUReesjcHTCNbSjVk9 OZsbqpYC61gCUk2uXJAEE6CQE/aq/OrQS/LFav6ePt4aeN8dGay7ihpXYy3mnFepWgE/ W05KBAtDJoJnVHDGJmlwAcjl9jAgNZlvZfk2AtKQ0EpxzEkw3T/MUl4ntv8QqCsVyej2 uZSGWHjX3IhEXlZ/DR1RQp3FtM/v3q3Yc75aUbUPspjONDF+2l85zZZRr9iTFVrvkXj8 qu1w== X-Received: by 10.224.216.135 with SMTP id hi7mr191313qab.28.1362686815541; Thu, 07 Mar 2013 12:06:55 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.224.216.135 with SMTP id hi7mr191180qab.28.1362686813885; Thu, 07 Mar 2013 12:06:53 -0800 (PST) Sender: wfitch@meetme.com Received: by 10.49.104.51 with HTTP; Thu, 7 Mar 2013 12:06:53 -0800 (PST) In-Reply-To: References: <5137D21C.1050907@sugarcrm.com> Date: Thu, 7 Mar 2013 15:06:53 -0500 X-Google-Sender-Auth: 0U6rDSmPMsLzQu7kGT4MKfaHG9w Message-ID: To: Bob Weinand Cc: Stas Malyshev , PHP List Developers Mailing Content-Type: multipart/alternative; boundary=20cf300fb05f7b70f604d75b3f4a X-Gm-Message-State: ALoCoQnDViXSG/maNehZa450ENUw3AK1bEGJo1QptIaDTpwmQTHCfYGpnP5zgo7en1NpcrN0QNrjC6PDgBxXnzwGXa2dO3+WsXQAcvJI4ntzREFQl3dgL1zc9t1se1JFmaj5gcMn28xYsvi89N0Kpkm+Dq7nepta7lvttYNjCycbx6GP8Qdpxks= Subject: Re: [PHP-DEV] [RFC] unset(): return bool if the variable has existed From: willfitch@php.net (Will Fitch) --20cf300fb05f7b70f604d75b3f4a Content-Type: text/plain; charset=ISO-8859-1 On Thu, Mar 7, 2013 at 7:10 AM, Bob Weinand wrote: > Am 7.3.2013 um 00:32 schrieb Stas Malyshev : > > > Hi! > > > >> RFC updated. > >> > >> Any other comments about this RFC? > > > > Could you provide a use case for this - which practical value this has? > > > > It also still contains factually incorrect claim that unset() is a > > function and that there's some "inconsistency" in the fact that it does > > not return value. > > > > Also, it is not clear what false returned from unset() actually means - > > did it fail to unset the value (i.e., it is still set) or there was > > nothing to unset (i.e., it is still not set)? > > -- > > Stanislav Malyshev, Software Architect > > SugarCRM: http://www.sugarcrm.com/ > > (408)454-6900 ext. 227 > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > Hi! > > The main practical value is in the __unset magic method. You can now > communicate through the "proper" way of a language construct with an > __unset method. (success or failure) > The practical value in __unset is that you can unset an unavailable "property". The goal of unset has never been to communicate anything. It simply destroys a variable. Furthermore, if you're looking to identify, based on your examples, if you need to do cleanup work if a variable is set, your application should check to see if that value is set. Unset is part of the cleanup work itself. It would be nice to see actual use cases in an application rather than examples showing that your very specific use cases would work with this change. I've yet to see any value added by this RFC. > > I've added a code example to the RFC. > > Bob Weinand > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --20cf300fb05f7b70f604d75b3f4a--