Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84541 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26259 invoked from network); 11 Mar 2015 13:03:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Mar 2015 13:03:51 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.178 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.178 mail-wi0-f178.google.com Received: from [209.85.212.178] ([209.85.212.178:45846] helo=mail-wi0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EE/F2-07702-53D30055 for ; Wed, 11 Mar 2015 08:03:50 -0500 Received: by wibbs8 with SMTP id bs8so11544982wib.4 for ; Wed, 11 Mar 2015 06:03:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=LQOkvdUeqJDm4aSYcuoIMbfQ8529bd+RzUWFcSt34oQ=; b=e/XUHBDO+bgtguYuO6ZhbZWPCjhMFSBhI2CpBD3iK6zWc8rH3qVttcxMOZjgaD009/ VYKkau29OucxxD0PbYXwtho3bFb+6LUkeBHItzxvBge+wLL9k+WFCuOXMYlaploF3gaW qEdaoGUzEtOgCINn0OGOCEE2uEVaEDhS/RZkrVsq+GlyQWqNN6JNf2IF9L4c/tTOa/j3 i1k3RTGDVOKz+BhRK/Qcfam5wk/SnLVtutt7bak33pBLO6jsv37Rammp7F47heMxGrZT z5VFPU3j8FS9EDg6ZGd2phAn3BOBNn/CYc2/RjtiBDeDCmADkqf93JgL3eLjpcIQPdAS seBw== X-Received: by 10.194.142.205 with SMTP id ry13mr79622719wjb.73.1426079027125; Wed, 11 Mar 2015 06:03:47 -0700 (PDT) Received: from [192.168.0.159] ([62.189.198.114]) by mx.google.com with ESMTPSA id uc18sm6103310wib.0.2015.03.11.06.03.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Mar 2015 06:03:46 -0700 (PDT) Message-ID: <55003D12.5010006@gmail.com> Date: Wed, 11 Mar 2015 13:03:14 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: internals@lists.php.net References: <24.71.03288.592FDF45@pb1.pair.com> <54FE20E5.1060605@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Request Feedback for Instance Variable Sugar RFC From: rowan.collins@gmail.com (Rowan Collins) Johannes Ott wrote on 10/03/2015 20:46: > okay indeed the dynamic properties are a problem I didn't think about on > my suggestion. Without the wish to hijack this thread for another > typesafety discussion, I must say again that PHP needs a less dynamic > and more declaratively properties concept in my opinion. Yes, I think a standard way to say that a particular object has strictly declared all its properties, and should not allow would be useful. (Even with that, though, I'd be against guessing that "$foo" meant "$this->foo"; it just makes code harder to read.) > So I would suggest for now to keep the $this variable, but to make it > more similar to other OOP-languages I would suggest to remove the > $-character in front. In my opinion it would fit better to other object > keywords like parent and self as well. Other OOP languages only don't have a sigil such as $ in front of this if they don't have one in front of *any* variable. Why should $this, which acts like a normal variable in pretty much every way, drop the $ when every other variable in the language has one? Note that the syntax of parent and self is different, and is consistent with static member/method access, or more strictly "scope resolution". You can't pass parent or self around as variables, only use them to resolve scopes, so they don't have a $. That's what sigils are for - making similar things look similar and distinct things look distinct. Regards, -- Rowan Collins [IMSoP]