com doc/ja: $this is not a **reference** to the called object.: language/oop5/basic.xml language/oop5/properties.xml language/references.xml
| From: | Yoshinari Takaoka | Date: | Sun, 24 Jan 2021 15:09:55 +0000 |
| Subject: | com doc/ja: $this is not a **reference** to the called object.: language/oop5/basic.xml language/oop5/properties.xml language/references.xml | ||
| Groups: | php.doc.ja | ||
| Request: | Send a blank email to doc-ja+get-6112@lists.php.net to get a copy of this message | ||
Commit: d0ab65119b9953c6f5adeeb8622283d347413d1a
Author: Yoshinari Takaoka <mumumu@mumumu.org> Mon, 25 Jan 2021 00:09:55 +0900
Parents: 4ee8377859d7dd2a5d428fec5e917f0045e6b25f
Branches: master
Link: http://git.php.net/?p=doc/ja.git;a=commitdiff;h=d0ab65119b9953c6f5adeeb8622283d347413d1a
Log:
$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.
Closes GH-380.
Changed paths:
M language/oop5/basic.xml
M language/oop5/properties.xml
M language/references.xml
Diff:
diff --git a/language/oop5/basic.xml b/language/oop5/basic.xml
index d3d8f7c8a0..54654fcb72 100644
--- a/language/oop5/basic.xml
+++ b/language/oop5/basic.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
-<!-- EN-Revision: 4317fec7555dd42621f88162cc5068092e5c5cfb Maintainer: takagi Status: ready
-->
+<!-- EN-Revision: 02f3bf57175c48abff767ad2c0961c6cfe58a39e Maintainer: takagi Status: ready
-->
<!-- CREDITS: hirokawa,mumumu -->
<sect1 xml:id="language.oop5.basic" xmlns="http://docbook.org/ns/docbook">
@@ -51,7 +51,7 @@ class SimpleClass
<para>
メソッドがオブジェクトのコンテキストからコールされる場合は、
疑似変数 <varname>$this</varname> が利用可能です。
- <varname>$this</varname>
は、呼び出し元オブジェクトへのリファレンスです。
+ <varname>$this</varname> は、呼び出し元オブジェクトの値です。
</para>
<warning>
<para>
diff --git a/language/oop5/properties.xml b/language/oop5/properties.xml
index 7e170a161c..b64c18b576 100644
--- a/language/oop5/properties.xml
+++ b/language/oop5/properties.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
-<!-- EN-Revision: a9edd62d087ab1eb6292c795b7256e14ff9f1234 Maintainer: takagi Status: ready
-->
+<!-- EN-Revision: 02f3bf57175c48abff767ad2c0961c6cfe58a39e Maintainer: takagi Status: ready
-->
<!-- CREDITS: mumumu -->
<sect1 xml:id="language.oop5.properties" xmlns="http://docbook.org/ns/docbook">
@@ -44,11 +44,11 @@
</para>
<para>
クラスのメソッドがオブジェクトのコンテキストからコールされたときには、
- 擬似変数 <varname>$this</varname> が常に使えます。
+ 擬似変数 <varname>$this</varname> が使えます。
<varname>$this</varname> は、呼び出し元のオブジェクト
(通常はそのメソッドが属するオブジェクトですが、別のオブジェクトになる可能性もあります。
別のオブジェクトのコンテキストから <link
linkend="language.oop5.static">静的に</link>
- コールされた場合などです) への参照となります。
+ コールされた場合などです) の値です。
</para>
<para>
diff --git a/language/references.xml b/language/references.xml
index e94cf49fc0..9e238dc296 100644
--- a/language/references.xml
+++ b/language/references.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
-<!-- EN-Revision: a71742330defbc0edfbc6822b4f947bf437b2f70 Maintainer: hirokawa Status: ready
-->
+<!-- EN-Revision: 02f3bf57175c48abff767ad2c0961c6cfe58a39e Maintainer: hirokawa Status: ready
-->
<!-- CREDITS: takagi,mumumu -->
<chapter xml:id="language.references" xmlns="http://docbook.org/ns/docbook">
<title>リファレンスの説明</title>
@@ -535,14 +535,6 @@ $var =& $GLOBALS["var"];
</simpara>
</sect2>
- <sect2 xml:id="references..this">
- <title><literal>$this</literal></title>
-
- <simpara>
- オブジェクトのメソッドでは、<varname>$this</varname> は
- 常にコール側のオブジェクトへのリファレンスです。
- </simpara>
- </sect2>
</sect1>
</chapter>