Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93493 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22250 invoked from network); 24 May 2016 21:00:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 May 2016 21:00:37 -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:36133] helo=mail-wm0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9E/90-17017-3F0C4475 for ; Tue, 24 May 2016 17:00:36 -0400 Received: by mail-wm0-f44.google.com with SMTP id n129so150286868wmn.1 for ; Tue, 24 May 2016 14:00:35 -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=TyzlIcvZKBBTsFbAZm87jVcGj9ps6NMv7IZak3bM85k=; b=qfnzicfgi7hy/kutIC9EbmSnCmal66ym8DmkD0sRhcjEkQXJI90jybssbnlE4jbY+1 w1uC+mz6I5vQP2EBatcoXamKlriPGVkTlcBqJHqkz4XcVBi8CGoMYDIDkquk7va7a9nX jVuYcdw9F5a2cdxR7EE5Gxh5iZ0CR80wz9MxQG1IA65sNegb3t9xh8zE7lOX3MH5N3pW KIjoeHEsIfmjykjVvBiP63DclAxW7PKy/hoK2hjbnWeLyMLxDMwNGyqVSmVTIZWIbnQw RJRTsC0DKSBn94AP5S9hmXygwGEdOCsdOcz9fQZgnkpVFvygBhxjkRUsb97Crmh6Hf+M vbXA== 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=TyzlIcvZKBBTsFbAZm87jVcGj9ps6NMv7IZak3bM85k=; b=nGizMTmnsrAe4lvbe5b82FX42FsaeFVQ+6L8zKMPe1rGxCtmD6w21/IgHktONo0+wo jMYelUngYbFL1Q/U4Q0OT3iUN+9UWdbS282zEp2zB6U0UUxFsYUoXNLdkcqoaAAe3mJ9 rkPaYBzaCg7oUKnkHLKkgpvABUdfqySb60nKPxPpX81V8TlMk9a2rD2G45RXzoospjwu 6NOBWQ92NnEh7wLOil7b2fe7jUCKe87/7tNUmFVWq4ebXKacPeHiwhrckrmqEoRi17Ar EhNO3YHJXG0JG6eZHZ8/dLGfneq3T2igdy46l8YqmjK7vtkb9JMWPrMMmID38c/IsOSp Ny1g== X-Gm-Message-State: ALyK8tK6xhx+yeZdWlvtw73YRxiAgLTuPzlQ+vJlhAFXDUfUR3PJSZI4JMeflbo6iVFThg== X-Received: by 10.194.175.68 with SMTP id by4mr162207wjc.51.1464123632856; Tue, 24 May 2016 14:00:32 -0700 (PDT) Received: from [192.168.1.5] ([2.25.96.65]) by smtp.googlemail.com with ESMTPSA id a63sm5564139wmh.11.2016.05.24.14.00.31 for (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 May 2016 14:00:32 -0700 (PDT) To: internals@lists.php.net References: <906d46a8-e0b3-9650-b8e1-be6ab669d545@mabe.berlin> Message-ID: Date: Tue, 24 May 2016 22:00:27 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <906d46a8-e0b3-9650-b8e1-be6ab669d545@mabe.berlin> 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 20:21, Marc Bennewitz wrote: > As of $this is a very special variable where only the engine is (or > should) be allowed to change. > I would like to ask you if it wouldn't be better to NOT define $this > as a special variable > including a lot of code to make sure this variable doesn't get > re-assigned > but instead define this as a keyword like self where the syntax makes > sure it can't be re-assigned > and it's less special and simpler to learn for beginners. It's an interesting concept, but most of the time $this *does* behave like a variable - it's not just a way of accessing scope like "self". You can write "foo($this)", "$bar = $this", even "echo $this" (if __toString is defined). So any syntax that made it look unlike a variable would have the opposite learning problem - how come I can use it like a variable, but it looks like something else? There's also rather a shortage of syntax that doesn't already mean something... Regards, -- Rowan Collins [IMSoP]