[doc-en] master: add missing string type for $title in Asymmetric Property inheritance example (#4833)

From: Date: Fri, 03 Oct 2025 14:40:48 +0000
Subject: [doc-en] master: add missing string type for $title in Asymmetric Property inheritance example (#4833)
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-22776@lists.php.net to get a copy of this message
Author: Hendrik Becker (LuckyFellow) Committer: GitHub (web-flow) Pusher: Crell Date: 2025-10-03T09:40:45-05:00 Commit: https://github.com/php/doc-en/commit/5c04cf0fd637b258d2a3bf7f4b7aba1beef6d823 Raw diff: https://github.com/php/doc-en/commit/5c04cf0fd637b258d2a3bf7f4b7aba1beef6d823.diff add missing string type for $title in Asymmetric Property inheritance example (#4833) Add the missing string type to $title in the SpecialBook class. The parent defines $title as string; the child must not drop the declared type. Changed paths: M language/oop5/visibility.xml Diff: diff --git a/language/oop5/visibility.xml b/language/oop5/visibility.xml index 8898d01becfd..465f7f87fe5c 100644 --- a/language/oop5/visibility.xml +++ b/language/oop5/visibility.xml @@ -194,7 +194,7 @@ class Book class SpecialBook extends Book { - public protected(set) $title; // OK, as reading is wider and writing the same. + public protected(set) string $title; // OK, as reading is wider and writing the same. public string $author; // OK, as reading is the same and writing is wider. public protected(set) int $pubYear; // Fatal Error. private(set) properties are final. }

« previous php.doc.cvs (#22776) next »