From d0a40a919514a5fd4408c8a8eb8c9152ad050a54 Mon Sep 17 00:00:00 2001 From: Tyson Andre Date: Sat, 23 Jan 2021 11:18:05 -0500 Subject: [PATCH] $this is not a **reference** to the called object. It's the value of the called object. Additionally, in php 7.1, it was no longer possible to reassign $this indirectly through a reference. Even in php 7.0, I'd think it would initially be more like a value (that references can be created from) than a reference, but I may be misunderstanding what this means or what $this did in php 5 or older. --- language/oop5/basic.xml | 2 +- language/oop5/properties.xml | 2 +- language/references.xml | 8 -------- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/language/oop5/basic.xml b/language/oop5/basic.xml index 223dab469ce7..73ab93c4062f 100644 --- a/language/oop5/basic.xml +++ b/language/oop5/basic.xml @@ -47,7 +47,7 @@ class SimpleClass The pseudo-variable $this is available when a method is called from within an object context. - $this is a reference to the calling object. + $this is the value of the calling object. diff --git a/language/oop5/properties.xml b/language/oop5/properties.xml index df719c9129d7..e1fa464ee8d1 100644 --- a/language/oop5/properties.xml +++ b/language/oop5/properties.xml @@ -40,7 +40,7 @@ The pseudo-variable $this is available inside any class method when that method is called from within an object - context. $this is a reference to the calling + context. $this is the value of the calling object (usually the object to which the method belongs, but possibly another object, if the method is called statically from the context diff --git a/language/references.xml b/language/references.xml index 4d45a073dc3c..6f2d3928d687 100644 --- a/language/references.xml +++ b/language/references.xml @@ -529,14 +529,6 @@ $var =& $GLOBALS["var"]; won't unset the global variable. - - - <literal>$this</literal> - - In an object method, $this is always a reference - to the called object. - -