language/predefined/serializable.xml
f94d903985119d3ac00f4528551df947f57b667f
...
...
@@ -1,6 +1,5 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-

4
3
<phpdoc:classref xml:id="class.serializable" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
5
4

6
5
<title>The Serializable interface</title>
...
...
@@ -20,18 +19,17 @@
20
19
<link linkend="object.sleep">__sleep()</link> and
21
20
<link linkend="object.wakeup">__wakeup()</link>. The method serialize is
22
21
called whenever an instance needs to be serialized. This does not invoke __destruct()
23
-
or has any other side effect unless programmed inside the method. When the data is
22
+
or have any other side effect unless programmed inside the method. When the data is
24
23
unserialized the class is known and the appropriate unserialize() method is called as
25
24
a constructor instead of calling __construct(). If you need to execute the standard
26
25
constructor you may do so in the method.
27
26
</para>
28
-
<para>
29
-
Note, that when an old instance of a class that implements this interface
30
-
now, which had been serialized before the class implemeted the interface, is
31
-
unserialized, <link linkend="object.wakeup">__wakeup()</link> is called
32
-
instead of the serialize method, what might be useful for migration
33
-
purposes.
34
-
</para>
27
+
28
+
<warning>
29
+
<para>
30
+
As of PHP 8.1.0, a class which implements <interfacename>Serializable</interfacename> without also implementing <link linkend="object.serialize">__serialize()</link> and <link linkend="object.unserialize">__unserialize()</link> will generate a deprecation warning.
31
+
</para>
32
+
</warning>
35
33
</section>
36
34
<!-- }}} -->
37
35

...
...
@@ -39,25 +37,22 @@
39
37
&reftitle.interfacesynopsis;
40
38

41
39
<!-- {{{ Synopsis -->
42
-
<classsynopsis>
43
-
<ooclass><classname>Serializable</classname></ooclass>
44
-

45
-
<!-- {{{ Class synopsis -->
46
-
<classsynopsisinfo>
47
-
<ooclass>
48
-
<classname>Serializable</classname>
49
-
</ooclass>
50
-
</classsynopsisinfo>
51
-
<!-- }}} -->
40
+
<classsynopsis class="interface">
41
+
<oointerface>
42
+
<interfacename>Serializable</interfacename>
43
+
</oointerface>
52
44

53
45
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
54
-
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.serializable')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
46
+
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.serializable')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='Serializable'])">
47
+
<xi:fallback/>
48
+
</xi:include>
55
49
</classsynopsis>
56
50
<!-- }}} -->
57
51

58
52
</section>
59
53

60
54
<section xml:id="serializable.examples">
55
+
&reftitle.examples;
61
56
<example xml:id="serializable.example.basic"><!-- {{{ -->
62
57
<title>Basic usage</title>
63
58
<programlisting role="php">
...
...
@@ -107,7 +102,6 @@ string(15) "My private data"
107
102
&language.predefined.serializable.unserialize;
108
103

109
104
</phpdoc:classref>
110
-

111
105
<!-- Keep this comment at the end of the file
112
106
Local variables:
113
107
mode: sgml
114
108