Skip to content

Commit

Permalink
Document T_PROPERTY_C constant (php#4184)
Browse files Browse the repository at this point in the history
Drive-by fixes and nits
  • Loading branch information
Girgias authored Nov 28, 2024
1 parent c1c803c commit 9418ae1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
7 changes: 7 additions & 0 deletions appendices/tokens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,13 @@ defined('T_FN') || define('T_FN', 10001);
property hooks (available as of PHP 8.4.0)
</entry>
</row>
<row xml:id="constant.t-property-c">
<entry><constant>T_PROPERTY_C</constant></entry>
<entry>__PROPERTY__</entry>
<entry>
<link linkend="language.constants.predefined">magic constants</link>
</entry>
</row>
<row xml:id="constant.t-protected">
<entry><constant>T_PROTECTED</constant></entry>
<entry>protected</entry>
Expand Down
12 changes: 7 additions & 5 deletions language/constants.xml
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,10 @@ echo ANIMALS[1]; // outputs "cat"
<sect1 xml:id="language.constants.magic">
<title>Magic constants</title>
<para>
There are nine magical constants that change depending on
There are a few magical constants that change depending on
where they are used. For example, the value of
<constant>__LINE__</constant> depends on the line that it's
used on in your script. All these "magical" constants are resolved
used on in a script. All these "magical" constants are resolved
at compile time, unlike regular constants, which are resolved at runtime.
These special constants are case-insensitive and are as follows:
</para>
Expand Down Expand Up @@ -303,8 +303,8 @@ echo ANIMALS[1]; // outputs "cat"
<entry>
The class name. The class name includes the namespace
it was declared in (e.g. <literal>Foo\Bar</literal>).
When used
in a trait method, __CLASS__ is the name of the class the trait
When used inside a trait method,
<constant>__CLASS__</constant> is the name of the class the trait
is used in.
</entry>
</row>
Expand All @@ -324,7 +324,9 @@ echo ANIMALS[1]; // outputs "cat"
<row xml:id="constant.property">
<entry><constant>__PROPERTY__</constant></entry>
<entry>
Only valid inside a <link linkend="language.oop5.property-hooks">property hook</link>. It is equal to the name of the property.
Only valid inside a
<link linkend="language.oop5.property-hooks">property hook</link>.
It is equal to the name of the property.
</entry>
</row>
<row xml:id="constant.namespace">
Expand Down

0 comments on commit 9418ae1

Please sign in to comment.