{"id":130,"date":"2026-11-12T08:00:00","date_gmt":"2026-11-12T07:00:00","guid":{"rendered":"https:\/\/hoja.in\/blog\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\/"},"modified":"2026-10-16T14:00:13","modified_gmt":"2026-10-16T12:00:13","slug":"php-8-4-property-hooks-and-asymmetric-visibility-in-practice","status":"publish","type":"post","link":"https:\/\/hoja.in\/blog\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\/","title":{"rendered":"PHP 8.4 property hooks and asymmetric visibility in practice"},"content":{"rendered":"<p>I have written <code>getTitle()<\/code> and <code>setTitle()<\/code> so many times in my life that my fingers type them alone. Most of them do nothing: return the property, assign the property. A few do one useful thing, like trimming a string or refusing an empty value, and for those few we kept all the others, &#8220;for consistency&#8221;.<\/p>\n<p>PHP 8.4 gives two features that attack exactly this boilerplate: <strong>property hooks<\/strong> and <strong>asymmetric visibility<\/strong>. My projects run on PHP 8.4 now (the hoja.in project pins <code>config.platform.php<\/code> to 8.4), so I started using them in real code. Here is what works well, and the one place where I deliberately do not use them. Every snippet below was run on PHP 8.4.<\/p>\n<h2>Property hooks: logic on the property itself<\/h2>\n<p>A property can now have a <code>set<\/code> hook and a <code>get<\/code> hook. The set hook runs on every write, also inside the class. That makes it a good place for validation and normalisation:<\/p>\n<pre><code class=\"language-php\">&lt;?php\n\ndeclare(strict_types=1);\n\nfinal class EventSlug\n{\n    public string $value {\n        set(string $value) {\n            $slug = strtolower(trim(preg_replace('\/[^a-z0-9]+\/i', '-', $value), '-'));\n            if ($slug === '') {\n                throw new InvalidArgumentException('A slug must not be empty.');\n            }\n            $this-&gt;value = $slug;\n        }\n    }\n\n    public function __construct(string $value)\n    {\n        $this-&gt;value = $value;\n    }\n}\n\n$slug = new EventSlug('  TYPO3 Camp Munich 2026! ');\necho $slug-&gt;value;              \/\/ typo3-camp-munich-2026\n$slug-&gt;value = 'Hello World';   \/\/ still validated: hello-world\nnew EventSlug('!!!');           \/\/ InvalidArgumentException<\/code><\/pre>\n<p>Inside the hook, <code>$this->value<\/code> writes the real stored value without calling the hook again. Outside, there is no way around it. Before 8.4 I would have needed a private property plus a getter plus a setter for the same guarantee.<\/p>\n<h3>Computed values with a get hook<\/h3>\n<p>If a property only has a <code>get<\/code> hook that never touches its own backing value, it is a <em>virtual<\/em> property. It uses no memory and cannot be written:<\/p>\n<pre><code class=\"language-php\">final class Speaker\n{\n    public string $fullName {\n        get =&gt; trim($this-&gt;firstName . ' ' . $this-&gt;lastName);\n    }\n\n    public function __construct(\n        public string $firstName,\n        public string $lastName,\n    ) {}\n}\n\n$speaker = new Speaker('Hoja', 'Latheef');\necho $speaker-&gt;fullName;        \/\/ Hoja Latheef\n$speaker-&gt;fullName = 'x';       \/\/ Error: Property Speaker::$fullName is read-only<\/code><\/pre>\n<p>In Fluid this is nice, because <code>{speaker.fullName}<\/code> just works, there is no getter to name correctly.<\/p>\n<h2>Asymmetric visibility: public to read, private to write<\/h2>\n<p>The second feature is shorter to explain. <code>public private(set)<\/code> means everyone can read the property, but only the class itself can write it. For value objects and result objects this replaces the classic &#8220;private property plus getter&#8221; pair:<\/p>\n<pre><code class=\"language-php\">final class ImportResult\n{\n    public private(set) int $created = 0;\n    public private(set) array $errors = [];\n\n    public bool $successful {\n        get =&gt; $this-&gt;errors === [];\n    }\n\n    public function recordCreated(): void\n    {\n        $this-&gt;created++;\n    }\n\n    public function recordError(string $message): void\n    {\n        $this-&gt;errors[] = $message;\n    }\n}\n\n$result = new ImportResult();\n$result-&gt;recordCreated();\n$result-&gt;recordError('Page 25: missing title');\n\necho $result-&gt;created;            \/\/ 1\nvar_dump($result-&gt;successful);    \/\/ false\n$result-&gt;created = 99;            \/\/ Error: Cannot modify private(set) property\n$result-&gt;errors[] = 'sneaky';     \/\/ Error: Cannot indirectly modify private(set) property<\/code><\/pre>\n<p>Why not <code>readonly<\/code>? Because <code>readonly<\/code> allows exactly one write. A counter that grows during an import needs many writes, but only from inside. That is precisely the gap <code>private(set)<\/code> closes. And note the last line: appending to the array from outside is blocked too, not only the full assignment.<\/p>\n<h2>Where they fit in a TYPO3 extension<\/h2>\n<h3>Your own PSR-14 events<\/h3>\n<p>Events are a sweet spot. Some fields are fixed context, one or two are meant to be changed by listeners, and those often have rules. Hooks work on promoted constructor properties as well:<\/p>\n<pre><code class=\"language-php\">final class ModifyTeaserLabelEvent\n{\n    public function __construct(\n        public readonly int $contentUid,\n        public string $label {\n            set(string $value) {\n                $value = trim($value);\n                if ($value === '') {\n                    throw new InvalidArgumentException('The label must not be empty.');\n                }\n                $this-&gt;label = $value;\n            }\n        },\n    ) {}\n}<\/code><\/pre>\n<p>A listener with <code>#[AsEventListener]<\/code> just writes <code>$event->label = 'Weiterlesen';<\/code>. The context (<code>contentUid<\/code>) stays read-only, and an empty label never reaches the template, no matter which extension registered the listener. The same event in PHP 8.3 style needs a getter, a setter with the check, and a private property: three places for one rule.<\/p>\n<h3>DTOs and API responses<\/h3>\n<p>For data transfer objects that a service fills and a controller or a JSON response reads, <code>public private(set)<\/code> plus a named constructor is my default now. Fluid, <code>json_encode()<\/code> and debuggers see public properties, and nobody can change them on the way.<\/p>\n<h2>Where I keep classic accessors: Extbase models<\/h2>\n<p>For Extbase domain models I stay with protected properties and getters and setters. Not because of style, but because of how Extbase hydrates objects. The <code>DataMapper<\/code> writes each column through <code>_setProperty()<\/code>, a method defined in <code>AbstractDomainObject<\/code>, the parent class of your model. I tested both features against the v14 <code>AbstractEntity<\/code>:<\/p>\n<pre><code class=\"language-php\">use TYPO3CMSExtbaseDomainObjectAbstractEntity;\n\nclass Event extends AbstractEntity\n{\n    public private(set) string $title = '';\n}\n\n(new Event())-&gt;_setProperty('title', 'TYPO3 Camp');\n\/\/ Error: Cannot modify private(set) property Event::$title from scope Event<\/code><\/pre>\n<p><code>private(set)<\/code> only allows writes from the declaring class, and the write happens in the parent&#8217;s method, so hydration fails. <code>protected(set)<\/code> would pass that check, and a <code>set<\/code> hook on a protected property does run during <code>_setProperty()<\/code>. But then your validation runs on every row loaded from the database. Old records that do not follow today&#8217;s rule suddenly throw exceptions in a list view. On top of that come lazy loading proxies, <code>ObjectStorage<\/code> relations and the property mapper for forms, which all have their own expectations about how a model is written. I have not tested all of those paths, and I do not want my first test to be in production. So: models stay classic, validation for forms stays in Extbase validators.<\/p>\n<h2>Small things that bit me<\/h2>\n<ul>\n<li><strong>Arrays with a set hook<\/strong> cannot be modified in place: <code>$bag->items[] = 1<\/code> fails with &#8220;Indirect modification \u00e2\u20ac\u00a6 is not allowed&#8221;. Write a method like <code>addItem()<\/code>.<\/li>\n<li><strong>Hooks and <code>readonly<\/code> do not mix<\/strong>: &#8220;Hooked properties cannot be readonly&#8221; is a compile error.<\/li>\n<li><strong>Interfaces can declare properties<\/strong>, like <code>public string $label { get; }<\/code>. A class can fulfil that with a plain public property, a readonly one or a hook.<\/li>\n<li><strong>Tooling<\/strong>: check that your PHPStan, Rector and IDE versions understand 8.4 syntax before you use it in an extension.<\/li>\n<li><strong>Extension support<\/strong>: these are syntax features. An extension that uses them cannot be installed on PHP 8.3 or older, so raise the PHP constraint in <code>composer.json<\/code> at the same time.<\/li>\n<\/ul>\n<p>For me, the rule of thumb is simple: new small objects (events, DTOs, value objects, result objects) get hooks and asymmetric visibility; Extbase models keep their accessors. Cheers!<\/p>\n<h2>Further reading<\/h2>\n<ul>\n<li><a href=\"https:\/\/www.php.net\/manual\/en\/language.oop5.property-hooks.php\">PHP manual: Property hooks<\/a><\/li>\n<li><a href=\"https:\/\/www.php.net\/manual\/en\/language.oop5.visibility.php\">PHP manual: Visibility, including asymmetric visibility<\/a><\/li>\n<li><a href=\"https:\/\/wiki.php.net\/rfc\/property-hooks\">RFC: Property hooks<\/a><\/li>\n<li><a href=\"https:\/\/wiki.php.net\/rfc\/asymmetric-visibility-v2\">RFC: Asymmetric visibility v2<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Property hooks and public private(set) remove a lot of getter and setter code in PHP 8.4. Where I use them in TYPO3 extensions, and why Extbase models keep classic accessors.<\/p>\n","protected":false},"author":1,"featured_media":131,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[14,30,32,5],"class_list":["post-130","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","tag-extbase","tag-extension-development","tag-php-8","tag-typo3"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>PHP 8.4 property hooks and asymmetric visibility<\/title>\n<meta name=\"description\" content=\"PHP 8.4 property hooks for validation and computed values, public private(set) for value objects, and where they fit in TYPO3 extensions and Extbase.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hoja.in\/blog\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PHP 8.4 property hooks and asymmetric visibility\" \/>\n<meta property=\"og:description\" content=\"PHP 8.4 property hooks for validation and computed values, public private(set) for value objects, and where they fit in TYPO3 extensions and Extbase.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hoja.in\/blog\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\/\" \/>\n<meta property=\"og:site_name\" content=\"Hoja Mustaffa Abdul Latheef \u00e2\u20ac\u201c Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hojaonline7\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-12T07:00:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/hoja.in\/blog\/wp-content\/uploads\/2026\/10\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Hoja Mustaffa Abdul Latheef\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hojaonline\" \/>\n<meta name=\"twitter:site\" content=\"@hojaonline\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Hoja Mustaffa Abdul Latheef\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/hoja.in\\\/blog\\\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hoja.in\\\/blog\\\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\\\/\"},\"author\":{\"name\":\"Hoja Mustaffa Abdul Latheef\",\"@id\":\"https:\\\/\\\/hoja.in\\\/blog\\\/#\\\/schema\\\/person\\\/e6fbd54c2061674d8ea3e7861d858c7b\"},\"headline\":\"PHP 8.4 property hooks and asymmetric visibility in practice\",\"datePublished\":\"2026-11-12T07:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/hoja.in\\\/blog\\\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\\\/\"},\"wordCount\":791,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/hoja.in\\\/blog\\\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/hoja.in\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice.jpg\",\"keywords\":[\"extbase\",\"Extension development\",\"PHP 8\",\"TYPO3\"],\"articleSection\":[\"PHP\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/hoja.in\\\/blog\\\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/hoja.in\\\/blog\\\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\\\/\",\"url\":\"https:\\\/\\\/hoja.in\\\/blog\\\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\\\/\",\"name\":\"PHP 8.4 property hooks and asymmetric visibility\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hoja.in\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/hoja.in\\\/blog\\\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/hoja.in\\\/blog\\\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/hoja.in\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice.jpg\",\"datePublished\":\"2026-11-12T07:00:00+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/hoja.in\\\/blog\\\/#\\\/schema\\\/person\\\/e6fbd54c2061674d8ea3e7861d858c7b\"},\"description\":\"PHP 8.4 property hooks for validation and computed values, public private(set) for value objects, and where they fit in TYPO3 extensions and Extbase.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/hoja.in\\\/blog\\\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/hoja.in\\\/blog\\\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/hoja.in\\\/blog\\\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\\\/#primaryimage\",\"url\":\"https:\\\/\\\/hoja.in\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice.jpg\",\"contentUrl\":\"https:\\\/\\\/hoja.in\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice.jpg\",\"width\":1200,\"height\":630,\"caption\":\"Fewer getters, same safety\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/hoja.in\\\/blog\\\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/hoja.in\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PHP 8.4 property hooks and asymmetric visibility in practice\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/hoja.in\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/hoja.in\\\/blog\\\/\",\"name\":\"Hoja Mustaffa Abdul Latheef \u00e2\u20ac\u201c Blog\",\"description\":\"Notes from daily work with TYPO3, PHP and AI-assisted engineering\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/hoja.in\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/hoja.in\\\/blog\\\/#\\\/schema\\\/person\\\/e6fbd54c2061674d8ea3e7861d858c7b\",\"name\":\"Hoja Mustaffa Abdul Latheef\",\"description\":\"Senior TYPO3 Developer at jweiland.net, TYPO3 CMS Certified Developer. I write about TYPO3 upgrades, extension development, PHP and AI-assisted engineering with Claude Code.\",\"sameAs\":[\"https:\\\/\\\/hoja.in\\\/\"],\"url\":\"https:\\\/\\\/hoja.in\\\/blog\\\/author\\\/hoja\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PHP 8.4 property hooks and asymmetric visibility","description":"PHP 8.4 property hooks for validation and computed values, public private(set) for value objects, and where they fit in TYPO3 extensions and Extbase.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/hoja.in\/blog\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\/","og_locale":"en_US","og_type":"article","og_title":"PHP 8.4 property hooks and asymmetric visibility","og_description":"PHP 8.4 property hooks for validation and computed values, public private(set) for value objects, and where they fit in TYPO3 extensions and Extbase.","og_url":"https:\/\/hoja.in\/blog\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\/","og_site_name":"Hoja Mustaffa Abdul Latheef \u00e2\u20ac\u201c Blog","article_publisher":"https:\/\/www.facebook.com\/hojaonline7","article_published_time":"2026-11-12T07:00:00+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/hoja.in\/blog\/wp-content\/uploads\/2026\/10\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice.jpg","type":"image\/jpeg"}],"author":"Hoja Mustaffa Abdul Latheef","twitter_card":"summary_large_image","twitter_creator":"@hojaonline","twitter_site":"@hojaonline","twitter_misc":{"Written by":"Hoja Mustaffa Abdul Latheef","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/hoja.in\/blog\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\/#article","isPartOf":{"@id":"https:\/\/hoja.in\/blog\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\/"},"author":{"name":"Hoja Mustaffa Abdul Latheef","@id":"https:\/\/hoja.in\/blog\/#\/schema\/person\/e6fbd54c2061674d8ea3e7861d858c7b"},"headline":"PHP 8.4 property hooks and asymmetric visibility in practice","datePublished":"2026-11-12T07:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/hoja.in\/blog\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\/"},"wordCount":791,"commentCount":0,"image":{"@id":"https:\/\/hoja.in\/blog\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\/#primaryimage"},"thumbnailUrl":"https:\/\/hoja.in\/blog\/wp-content\/uploads\/2026\/10\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice.jpg","keywords":["extbase","Extension development","PHP 8","TYPO3"],"articleSection":["PHP"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/hoja.in\/blog\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/hoja.in\/blog\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\/","url":"https:\/\/hoja.in\/blog\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\/","name":"PHP 8.4 property hooks and asymmetric visibility","isPartOf":{"@id":"https:\/\/hoja.in\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/hoja.in\/blog\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\/#primaryimage"},"image":{"@id":"https:\/\/hoja.in\/blog\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\/#primaryimage"},"thumbnailUrl":"https:\/\/hoja.in\/blog\/wp-content\/uploads\/2026\/10\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice.jpg","datePublished":"2026-11-12T07:00:00+00:00","author":{"@id":"https:\/\/hoja.in\/blog\/#\/schema\/person\/e6fbd54c2061674d8ea3e7861d858c7b"},"description":"PHP 8.4 property hooks for validation and computed values, public private(set) for value objects, and where they fit in TYPO3 extensions and Extbase.","breadcrumb":{"@id":"https:\/\/hoja.in\/blog\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hoja.in\/blog\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/hoja.in\/blog\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\/#primaryimage","url":"https:\/\/hoja.in\/blog\/wp-content\/uploads\/2026\/10\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice.jpg","contentUrl":"https:\/\/hoja.in\/blog\/wp-content\/uploads\/2026\/10\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice.jpg","width":1200,"height":630,"caption":"Fewer getters, same safety"},{"@type":"BreadcrumbList","@id":"https:\/\/hoja.in\/blog\/php-8-4-property-hooks-and-asymmetric-visibility-in-practice\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/hoja.in\/blog\/"},{"@type":"ListItem","position":2,"name":"PHP 8.4 property hooks and asymmetric visibility in practice"}]},{"@type":"WebSite","@id":"https:\/\/hoja.in\/blog\/#website","url":"https:\/\/hoja.in\/blog\/","name":"Hoja Mustaffa Abdul Latheef \u00e2\u20ac\u201c Blog","description":"Notes from daily work with TYPO3, PHP and AI-assisted engineering","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/hoja.in\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/hoja.in\/blog\/#\/schema\/person\/e6fbd54c2061674d8ea3e7861d858c7b","name":"Hoja Mustaffa Abdul Latheef","description":"Senior TYPO3 Developer at jweiland.net, TYPO3 CMS Certified Developer. I write about TYPO3 upgrades, extension development, PHP and AI-assisted engineering with Claude Code.","sameAs":["https:\/\/hoja.in\/"],"url":"https:\/\/hoja.in\/blog\/author\/hoja\/"}]}},"_links":{"self":[{"href":"https:\/\/hoja.in\/blog\/wp-json\/wp\/v2\/posts\/130","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hoja.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hoja.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hoja.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hoja.in\/blog\/wp-json\/wp\/v2\/comments?post=130"}],"version-history":[{"count":1,"href":"https:\/\/hoja.in\/blog\/wp-json\/wp\/v2\/posts\/130\/revisions"}],"predecessor-version":[{"id":188,"href":"https:\/\/hoja.in\/blog\/wp-json\/wp\/v2\/posts\/130\/revisions\/188"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hoja.in\/blog\/wp-json\/wp\/v2\/media\/131"}],"wp:attachment":[{"href":"https:\/\/hoja.in\/blog\/wp-json\/wp\/v2\/media?parent=130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hoja.in\/blog\/wp-json\/wp\/v2\/categories?post=130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hoja.in\/blog\/wp-json\/wp\/v2\/tags?post=130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}