Skip to content

Commit 9a97441

Browse files
Update zend_constant docs
1 parent b78f217 commit 9a97441

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

docs/source/core/data-structures/zend_constant.rst

+15-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ PHP constants (referring to non-class constants) are stored in a dedicated struc
1515
zval value;
1616
zend_string *name;
1717
zend_string *filename;
18+
HashTable *attributes;
1819
} zend_constant;
1920
2021
The ``value`` field stores both the value itself and some metadata. The ``name`` and ``filename``
21-
store the name of the constant and the name of the file in which it was defined.
22+
store the name of the constant and the name of the file in which it was defined. The ``attributes``
23+
field stores the attributes applied to the constant.
2224

2325
*******
2426
value
@@ -59,6 +61,15 @@ constants that have already been defined. This string is released when the const
5961
filename
6062
**********
6163

62-
Finally, the ``filename`` holds another ``zend_string`` with the name of the file in which the
63-
constant was defined, or ``NULL`` if not defined userland code. This field provides the foundation
64-
for the PHP method ``ReflectionConstant::getFileName()``.
64+
The ``filename`` holds another ``zend_string`` with the name of the file in which the constant was
65+
defined, or ``NULL`` if not defined userland code. This field provides the foundation for the PHP
66+
method ``ReflectionConstant::getFileName()``.
67+
68+
************
69+
attributes
70+
************
71+
72+
Finally, the ``attributes`` holds a ``HashTable`` (essentially an array) with the details of the
73+
attributes that were applied to the constant. Note that attributes can only be added to constants
74+
declared at compile time via ``const``, e.g. ``const EXAMPLE = 123``, not those declared at runtime,
75+
e.g. ``define( 'EXAMPLE', 123 );``.

0 commit comments

Comments
 (0)