[doc-en] master: Fix grammar in predefined (#5755)

From: Date: Wed, 12 Aug 2026 22:15:25 +0000
Subject: [doc-en] master: Fix grammar in predefined (#5755)
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-23558@lists.php.net to get a copy of this message
Author: Kamil Tekiela (kamil-tekiela) Committer: GitHub (web-flow) Pusher: kamil-tekiela Date: 2026-08-12T23:15:22+01:00 Commit: https://github.com/php/doc-en/commit/029f19dbc090e4d249a23c0ab087d47059b37adc Raw diff: https://github.com/php/doc-en/commit/029f19dbc090e4d249a23c0ab087d47059b37adc.diff Fix grammar in predefined (#5755) Changed paths: M language/predefined/arrayaccess.xml M language/predefined/iterator.xml M language/predefined/serializable.xml M language/predefined/stdclass.xml M language/predefined/traversable.xml M language/predefined/valueerror.xml M language/predefined/weakmap.xml M language/predefined/weakreference.xml Diff: diff --git a/language/predefined/arrayaccess.xml b/language/predefined/arrayaccess.xml index ba76035c745d..512925d7ebb8 100644 --- a/language/predefined/arrayaccess.xml +++ b/language/predefined/arrayaccess.xml @@ -9,9 +9,9 @@ <section xml:id="arrayaccess.intro"> &reftitle.intro; - <para> - Interface to provide accessing objects as arrays. - </para> + <simpara> + Interface to provide access to objects as arrays. + </simpara> </section> <section xml:id="arrayaccess.synopsis"> diff --git a/language/predefined/iterator.xml b/language/predefined/iterator.xml index 550b5b84ee9d..04b3a9620a39 100644 --- a/language/predefined/iterator.xml +++ b/language/predefined/iterator.xml @@ -36,10 +36,10 @@ <section xml:id="iterator.iterators"> <title>Predefined iterators</title> - <para> - PHP already provides a number of iterators for many day to day tasks. + <simpara> + PHP already provides a number of iterators for many day-to-day tasks. See <link linkend="spl.iterators">SPL iterators</link> for a list. - </para> + </simpara> </section> <section xml:id="iterator.examples"> diff --git a/language/predefined/serializable.xml b/language/predefined/serializable.xml index 7e041aa0e7d2..636e5b249ceb 100644 --- a/language/predefined/serializable.xml +++ b/language/predefined/serializable.xml @@ -13,16 +13,20 @@ Interface for customized serializing. </para> - <para> + <simpara> Classes that implement this interface no longer support <link linkend="object.sleep">__sleep()</link> and - <link linkend="object.wakeup">__wakeup()</link>. The method serialize is - called whenever an instance needs to be serialized. This does not invoke __destruct() - or have any other side effect unless programmed inside the method. When the data is - unserialized the class is known and the appropriate unserialize() method is called as - a constructor instead of calling __construct(). If you need to execute the standard - constructor you may do so in the method. - </para> + <link linkend="object.wakeup">__wakeup()</link>. + The <methodname>serialize</methodname> method is + called whenever an instance needs to be serialized. + This does not invoke <methodname>__destruct</methodname> + or have any other side effect unless programmed inside the method. + When the data is unserialized the class is known and the appropriate + <methodname>unserialize</methodname> method is called as + a constructor instead of calling <methodname>__construct</methodname>. + The constructor can be called from within the + <methodname>unserialize</methodname> method if desired. + </simpara> <warning> <para> diff --git a/language/predefined/stdclass.xml b/language/predefined/stdclass.xml index db51a127c73e..29c5164116c7 100644 --- a/language/predefined/stdclass.xml +++ b/language/predefined/stdclass.xml @@ -13,14 +13,14 @@ A generic empty class with dynamic properties. </para> - <para> - Objects of this class can be instantiated with + <simpara> + Objects of this class can be instantiated with the <link linkend="language.oop5.basic.new">new</link> operator or created by <link linkend="language.types.object.casting">typecasting to object</link>. Several PHP functions also create instances of this class, e.g. <function>json_decode</function>, <function>mysqli_fetch_object</function> or <methodname>PDOStatement::fetchObject</methodname>. - </para> + </simpara> <para> Despite not implementing @@ -29,12 +29,12 @@ <code>#[\AllowDynamicProperties]</code> attribute. </para> - <para> + <simpara> This is not a base class as PHP does not have a concept of a universal base - class. However, it is possible to create a custom class that extends from + class. However, it is possible to create a custom class that extends <classname>stdClass</classname> and as a result inherits the functionality of dynamic properties. - </para> + </simpara> </section> <section xml:id="stdclass.synopsis"> diff --git a/language/predefined/traversable.xml b/language/predefined/traversable.xml index 34fae742a5a2..106e3dbdd121 100644 --- a/language/predefined/traversable.xml +++ b/language/predefined/traversable.xml @@ -29,7 +29,7 @@ </classsynopsis> <simpara> - This interface has no methods, its only purpose is to be the base + This interface has no methods; its only purpose is to be the base interface for all traversable classes. </simpara> diff --git a/language/predefined/valueerror.xml b/language/predefined/valueerror.xml index a08a51ae6976..0db48cb13de7 100644 --- a/language/predefined/valueerror.xml +++ b/language/predefined/valueerror.xml @@ -8,13 +8,13 @@ <section xml:id="valueerror.intro"> &reftitle.intro; - <para> + <simpara> A <classname>ValueError</classname> is thrown when the - type of an argument is correct but the value of it is incorrect. + type of an argument is correct but its value is incorrect. For example, passing a negative integer when the function expects a positive one, or passing an empty string/array when the function expects it to not be empty. - </para> + </simpara> </section> <section xml:id="valueerror.synopsis"> diff --git a/language/predefined/weakmap.xml b/language/predefined/weakmap.xml index 987e3f90c426..8e2904df38ac 100644 --- a/language/predefined/weakmap.xml +++ b/language/predefined/weakmap.xml @@ -9,14 +9,14 @@ <section xml:id="weakmap.intro"> &reftitle.intro; - <para> - A <classname>WeakMap</classname> is map (or dictionary) that accepts objects as keys. However, unlike the - otherwise similar <classname>SplObjectStorage</classname>, an object in a key of <classname>WeakMap</classname> + <simpara> + A <classname>WeakMap</classname> is a map (or dictionary) that accepts objects as keys. However, unlike the + otherwise similar <classname>SplObjectStorage</classname>, an object in a key of a <classname>WeakMap</classname> does not contribute toward the object's reference count. That is, if at any point the only remaining reference to an object is the key of a <classname>WeakMap</classname>, the object will be garbage collected and removed from the <classname>WeakMap</classname>. Its primary use case is for building caches of data derived from an object that do not need to live longer than the object. - </para> + </simpara> <para> <classname>WeakMap</classname> implements <interfacename>ArrayAccess</interfacename>, <interfacename>Traversable</interfacename> (via <interfacename>IteratorAggregate</interfacename>), @@ -56,7 +56,7 @@ &reftitle.examples; <para> <example> - <title><classname>Weakmap</classname> usage example</title> + <title><classname>WeakMap</classname> usage example</title> <programlisting role="php"> <![CDATA[ <?php diff --git a/language/predefined/weakreference.xml b/language/predefined/weakreference.xml index b4a1ffc588a5..92a4057698b9 100644 --- a/language/predefined/weakreference.xml +++ b/language/predefined/weakreference.xml @@ -9,15 +9,16 @@ <section xml:id="weakreference.intro"> &reftitle.intro; - <para> - Weak references allow the programmer to retain a reference to an object which does not prevent - the object from being destroyed. They are useful for implementing cache like structures. + <simpara> + Weak references allow the programmer to retain a reference to an object + without preventing the object from being destroyed. + They are useful for implementing cache-like structures. If the original object has been destroyed, &null; will be returned when calling the <methodname>WeakReference::get</methodname> method. The original object will be destroyed when the <link linkend="features.gc.refcounting-basics">refcount</link> for it drops to zero; creating weak references does not increase the <literal>refcount</literal> of the object being referenced. - </para> + </simpara> <simpara> <classname>WeakReference</classname>s cannot be serialized. </simpara>

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