[DOC-CVS] [doc-en] master: property-hooks: add missing `$modified` declaration to example 4 (#5124)
[email protected] (Daniel Scherzer via GitHub) Tue, 17 Feb 2026 18:25:19 +0000
| Newsgroups | php.doc.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: Daniel Scherzer (DanielEScherzer)
Committer: GitHub (web-flow)
Pusher: DanielEScherzer
Date: 2026-02-17T10:25:16-08:00
Commit: https://github.com/php/doc-en/commit/88eb0d53c6520804fb1dc17f35fa481451657fb7
Raw diff: https://github.com/php/doc-en/commit/88eb0d53c6520804fb1dc17f35fa481451657fb7.diff
property-hooks: add missing `$modified` declaration to example 4 (#5124)
Changed paths:
M language/oop5/property-hooks.xml
Diff:
diff --git a/language/oop5/property-hooks.xml b/language/oop5/property-hooks.xml
index 94d460f43b97..e41a217c5387 100644
--- a/language/oop5/property-hooks.xml
+++ b/language/oop5/property-hooks.xml
@@ -183,6 +183,8 @@ class Example
<?php
class Example
{
+ private bool $modified = false;
+
public string $foo = 'default value' {
get => $this->foo . ($this->modified ? ' (modified)' : '');
set => strtolower($value);