Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93482 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73802 invoked from network); 24 May 2016 09:59:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 May 2016 09:59:00 -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 74.125.82.44 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.44 mail-wm0-f44.google.com Received: from [74.125.82.44] ([74.125.82.44:37632] helo=mail-wm0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4B/76-37212-3E524475 for ; Tue, 24 May 2016 05:58:59 -0400 Received: by mail-wm0-f44.google.com with SMTP id z87so16990025wmh.0 for ; Tue, 24 May 2016 02:58:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=GB8rI/COsRq/ZChlx4FOWB5Y8uzV7vfNZEVzLgYamy8=; b=a+yYySjYEAkzOp6f2GFpoT1qIUXmLke1g8Z4BgQ8sO8g1USQeD5OcKUia1GLwCkINh aB0g8pgVbJV0NGDG3n9IhZzi3jsEuyydp84xG9VCVnBpRw/a6+q0xkvnWpDcemFrQ/n2 Gi89Z7UgXgSVqfiFejsarE1X/pnfMN7M2jOLQnChlowWOsJKcWXjjQejCp6vjmyH1mNS bP2PM8kf+77NBl4S1GU9wPnYdBcivwQLklT9I6eD4UtwvhP1OTmv6Yq/hOzhtOmKCGi7 dCDSBKj0RQ85DrXJTXFCu2CCdDXxR167xqVnO8HYc3FWqubgf7p8/rtrQoV0PwJ1nleU +rjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=GB8rI/COsRq/ZChlx4FOWB5Y8uzV7vfNZEVzLgYamy8=; b=MYZyaHVM1XjFtIgmNYaRvsGa43wNnNVtVAX7pkoRNPsd8nvfgKmxTVNublqOx99LlA YMRVnN/CAKWFG7lTjrYHW6KGfnA3BeSljsq1OXrIlZcMQJnSdhz2TNTiJbI3T57LhUQY Dnq/Aq2Jr0e7LOAq/ucXXv+gkzBBcuyJT2OmgS763AIUZ4FTeOxeeq6RswxyrE+bPbNv ZU14SfTok9pTUwsxilB+Y4aoMGZJkkb+oJrVo3I43rywG/YexmpYmFxNgJ/B6P2gv07f ULVkmoouRZdmz0tnPnadgDuEl//eJX9yBIO8Wsx5JJubKmGYfCHxSvxiPf+GMfIaYx9s F/jQ== X-Gm-Message-State: ALyK8tIAPzxwgi9mTBoX/DiyaQQqHUWrUZp1Jb1jUpBsQjAC1HyOZx+4yw3BY4XcpAWiFg== X-Received: by 10.194.204.233 with SMTP id lb9mr3231739wjc.147.1464083936957; Tue, 24 May 2016 02:58:56 -0700 (PDT) Received: from [192.168.0.98] ([93.188.182.58]) by smtp.gmail.com with ESMTPSA id d86sm18280418wmh.4.2016.05.24.02.58.56 for (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 May 2016 02:58:56 -0700 (PDT) To: internals@lists.php.net References: Message-ID: Date: Tue, 24 May 2016 10:57:24 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable From: rowan.collins@gmail.com (Rowan Collins) On 24/05/2016 06:45, Jesse Schalken wrote: > I'm curious, what is it about $this that makes it special in the first > place? Can't it be a normal local variable that happens to already be > assigned at the start of a method? There are a few things that take advantage of its specialness, e.g. - binding a closure to an object changes the meaning of $this in a way very different from assigning it into scope with "use($this)" - a method declared static can detect and throw errors on anything referencing $this - when calling parent::foo() from an instance method, the value of $this needs to be set appropriately on the new method; being able to reassign $this could lead to some odd behaviour there Python's approach is certainly valid, and leads to some different useful properties, I'm sure, but it's a very different design, not just a more relaxed attitude to assignment. Regadrds, -- Rowan Collins [IMSoP]