Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93478 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65191 invoked from network); 24 May 2016 08:41:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 May 2016 08:41:41 -0000 Authentication-Results: pb1.pair.com header.from=jesseschalken@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=jesseschalken@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.175 as permitted sender) X-PHP-List-Original-Sender: jesseschalken@gmail.com X-Host-Fingerprint: 209.85.223.175 mail-io0-f175.google.com Received: from [209.85.223.175] ([209.85.223.175:35404] helo=mail-io0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E4/05-37212-4C314475 for ; Tue, 24 May 2016 04:41:40 -0400 Received: by mail-io0-f175.google.com with SMTP id p64so7828222ioi.2 for ; Tue, 24 May 2016 01:41:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=QrKJqR78fbu5GZGliYVzlTr4DL1Z49AejRU+KLiGed8=; b=ESKqKA446Q4ar9q6NjG3vQTxjQribpkj1rl8pXRV7LeqeY869e1jM7smGFuOxfjBZH r7Sajkza5sT1F38J298UoD10JHV/dShKGQuBhVHJ5PW/8qLOkYboxeBiSSya/z2HE2G7 0ZjSCUdQdUYNqUbrch/155EoSHUK8UFRwg5Tv5nRj3SEbPG1hQXmTW/iqDrISmT8mMpm 63VdVazfFv8U5No4ILAwZCBX9sT9odlbB28mtbIHKV7aOjnHxR3RZKOWG1MOnbVQz8S6 3kJA5WpkMdf/B7V2/Gc6YIi1DqROPzQes7eG61uXCgVUKRZ/vFQf3q+selUi1y+ffLat puow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=QrKJqR78fbu5GZGliYVzlTr4DL1Z49AejRU+KLiGed8=; b=AlMRNcCUl9oa59E1kTwGUFCkt1TTruOXbp7lxGFWD+FQGi33MBZUeItpwVfPAp28L5 ZkejrvanZmfxnkC40cC5CR0NcnBZqSbcoonEvSHOacnZoxXv6WdTQ+VdHNNBvj+Sb4sv 7VnUBObAJ8etd+t+89weEsDOy1bOOP3bVtRyp3sfXb1rVPNllz58748qwKXdSboNIGbv tfnWcXh5KqKOi98J9kno0eXb+QMMBCLE6Q5O1Y3c+qVYl+eKpX45eYjx9nXKUJENEHFT Ou/ASPwru4XcErP8k7MnDAwNcS0BAG5KIB7huuNkc194HHxhirh8UiNEeKjEC7ZvWZuM /9Wg== X-Gm-Message-State: ALyK8tIL7VeXU60lFYf0tPBVccqNGDBSI7/hyNVuAeyLAVVBPy0ps4jBwWIkclzO2JrBJmO6eDzHUX2lFngdgQ== MIME-Version: 1.0 X-Received: by 10.107.180.11 with SMTP id d11mr12048790iof.151.1464079297649; Tue, 24 May 2016 01:41:37 -0700 (PDT) Sender: jesseschalken@gmail.com Received: by 10.79.111.208 with HTTP; Tue, 24 May 2016 01:41:37 -0700 (PDT) In-Reply-To: References: Date: Tue, 24 May 2016 18:41:37 +1000 X-Google-Sender-Auth: q6-1sbznTggJ_EpaE5uF2Q5UiE4 Message-ID: To: Yasuo Ohgaki Cc: Dmitry Stogov , internals , Nikita Popov , Bob Weinand , Xinchen Hui Content-Type: multipart/alternative; boundary=94eb2c05c61075c88c0533928673 Subject: Re: [PHP-DEV] [RFC] Fix inconsistent behavior of $this variable From: me@jesseschalken.com (Jesse Schalken) --94eb2c05c61075c88c0533928673 Content-Type: text/plain; charset=UTF-8 On Tue, May 24, 2016 at 5:54 PM, Yasuo Ohgaki wrote: > Jesse, > > $this must be a object you're accessing. > Why? I consider it a kind of implied parameter. You can reassign self in Python for example. class MyClass: def foo(self, p1, p2): self = 7 print(self, p1, p2) c = MyClass() c.foo(8, 3); # 7 8 3 I can't think of anything else that allows it, though. If you can change $this, you'll suddenly loose object. > That's what tends to happen when you assign a variable. > PHP 4 treated $this as regular variable and caused lots of problems. > I'll have to take your word for it. I just thought the language would be simpler with fewer "special" things that don't need to be special. > Regards, > > -- > Yasuo Ohgaki > yohgaki@ohgaki.net > --94eb2c05c61075c88c0533928673--