File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99
1010 <section xml : id =" arrayaccess.intro" >
1111&reftitle.intro;
12- <para >
13- Interface to provide accessing objects as arrays.
14- </para >
12+ <simpara >
13+ Interface to provide access to objects as arrays.
14+ </simpara >
1515 </section >
1616
1717 <section xml : id =" arrayaccess.synopsis" >
Original file line number Diff line number Diff line change 3636
3737 <section xml : id =" iterator.iterators" >
3838 <title >Predefined iterators</title >
39- <para >
40- PHP already provides a number of iterators for many day to day tasks.
39+ <simpara >
40+ PHP already provides a number of iterators for many day-to- day tasks.
4141 See <link linkend =" spl.iterators" >SPL iterators</link > for a list.
42- </para >
42+ </simpara >
4343 </section >
4444
4545 <section xml : id =" iterator.examples" >
Original file line number Diff line number Diff line change 1313 Interface for customized serializing.
1414 </para >
1515
16- <para >
16+ <simpara >
1717 Classes that implement this interface no longer support
1818 <link linkend =" object.sleep" >__sleep()</link > and
19- <link linkend =" object.wakeup" >__wakeup()</link >. The method serialize is
20- called whenever an instance needs to be serialized. This does not invoke __destruct()
21- or have any other side effect unless programmed inside the method. When the data is
22- unserialized the class is known and the appropriate unserialize() method is called as
23- a constructor instead of calling __construct(). If you need to execute the standard
24- constructor you may do so in the method.
25- </para >
19+ <link linkend =" object.wakeup" >__wakeup()</link >.
20+ The <methodname >serialize</methodname > method is
21+ called whenever an instance needs to be serialized.
22+ This does not invoke <methodname >__destruct</methodname >
23+ or have any other side effect unless programmed inside the method.
24+ When the data is unserialized the class is known and the appropriate
25+ <methodname >unserialize</methodname > method is called as
26+ a constructor instead of calling <methodname >__construct</methodname >.
27+ The constructor can be called from within the
28+ <methodname >unserialize</methodname > method if desired.
29+ </simpara >
2630
2731 <warning >
2832 <para >
Original file line number Diff line number Diff line change 1313 A generic empty class with dynamic properties.
1414 </para >
1515
16- <para >
17- Objects of this class can be instantiated with
16+ <simpara >
17+ Objects of this class can be instantiated with the
1818 <link linkend =" language.oop5.basic.new" >new</link > operator or created by
1919 <link linkend =" language.types.object.casting" >typecasting to object</link >.
2020 Several PHP functions also create instances of this class, e.g.
2121 <function >json_decode</function >, <function >mysqli_fetch_object</function >
2222 or <methodname >PDOStatement::fetchObject</methodname >.
23- </para >
23+ </simpara >
2424
2525 <para >
2626 Despite not implementing
2929 <code >#[\AllowDynamicProperties]</code > attribute.
3030 </para >
3131
32- <para >
32+ <simpara >
3333 This is not a base class as PHP does not have a concept of a universal base
34- class. However, it is possible to create a custom class that extends from
34+ class. However, it is possible to create a custom class that extends
3535 <classname >stdClass</classname > and as a result inherits the functionality
3636 of dynamic properties.
37- </para >
37+ </simpara >
3838 </section >
3939
4040 <section xml : id =" stdclass.synopsis" >
Original file line number Diff line number Diff line change 2929 </classsynopsis >
3030
3131 <simpara >
32- This interface has no methods, its only purpose is to be the base
32+ This interface has no methods; its only purpose is to be the base
3333 interface for all traversable classes.
3434 </simpara >
3535
Original file line number Diff line number Diff line change 88
99 <section xml : id =" valueerror.intro" >
1010&reftitle.intro;
11- <para >
11+ <simpara >
1212 A <classname >ValueError</classname > is thrown when the
13- type of an argument is correct but the value of it is incorrect.
13+ type of an argument is correct but its value is incorrect.
1414 For example, passing a negative integer when the function expects a
1515 positive one, or passing an empty string/array when the function expects
1616 it to not be empty.
17- </ para >
17+ </ simpara >
1818 </section >
1919
2020 <section xml : id =" valueerror.synopsis" >
Original file line number Diff line number Diff line change 99
1010 <section xml : id =" weakmap.intro" >
1111&reftitle.intro;
12- <para >
13- A <classname >WeakMap</classname > is map (or dictionary) that accepts objects as keys. However, unlike the
14- otherwise similar <classname >SplObjectStorage</classname >, an object in a key of <classname >WeakMap</classname >
12+ <simpara >
13+ A <classname >WeakMap</classname > is a map (or dictionary) that accepts objects as keys. However, unlike the
14+ otherwise similar <classname >SplObjectStorage</classname >, an object in a key of a <classname >WeakMap</classname >
1515 does not contribute toward the object's reference count. That is, if at any point the only remaining reference
1616 to an object is the key of a <classname >WeakMap</classname >, the object will be garbage collected and removed
1717 from the <classname >WeakMap</classname >. Its primary use case is for building caches of data derived from
1818 an object that do not need to live longer than the object.
19- </para >
19+ </simpara >
2020 <para >
2121 <classname >WeakMap</classname > implements <interfacename >ArrayAccess</interfacename >,
2222 <interfacename >Traversable</interfacename > (via <interfacename >IteratorAggregate</interfacename >),
5656&reftitle.examples;
5757 <para >
5858 <example >
59- <title ><classname >Weakmap </classname > usage example</title >
59+ <title ><classname >WeakMap </classname > usage example</title >
6060 <programlisting role =" php" >
6161<![CDATA[
6262<?php
Original file line number Diff line number Diff line change 99
1010 <section xml : id =" weakreference.intro" >
1111&reftitle.intro;
12- <para >
13- Weak references allow the programmer to retain a reference to an object which does not prevent
14- the object from being destroyed. They are useful for implementing cache like structures.
12+ <simpara >
13+ Weak references allow the programmer to retain a reference to an object
14+ without preventing the object from being destroyed.
15+ They are useful for implementing cache-like structures.
1516 If the original object has been destroyed, &null; will be returned
1617 when calling the <methodname >WeakReference::get</methodname > method.
1718 The original object will be destroyed when the
1819 <link linkend =" features.gc.refcounting-basics" >refcount</link > for it drops to zero;
1920 creating weak references does not increase the <literal >refcount</literal > of the object being referenced.
20- </para >
21+ </simpara >
2122 <simpara >
2223 <classname >WeakReference</classname >s cannot be serialized.
2324 </simpara >
You can’t perform that action at this time.
0 commit comments