summaryrefslogtreecommitdiffstats
path: root/msgpack-php81.patch
blob: c036e03efe60d12979071923e572b3180fa59f5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
From fff660a6f85b69e5dfe090f767cad13531d4ce3e Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Thu, 10 Jun 2021 10:15:13 +0200
Subject: [PATCH] Fix The Serializable interface is deprecated...

---
 tests/021.phpt | 8 ++++++++
 tests/031.phpt | 8 ++++++++
 tests/042.phpt | 8 ++++++++
 3 files changed, 24 insertions(+)

diff --git a/tests/021.phpt b/tests/021.phpt
index 137d100..c5cb364 100644
--- a/tests/021.phpt
+++ b/tests/021.phpt
@@ -38,6 +38,14 @@ class Obj implements Serializable {
         $tmp = unpack('N*', $serialized);
         $this->__construct($tmp[1], $tmp[2]);
     }
+
+    public function __serialize() {
+        return $this->serialize();
+    }
+
+    public function __unserialize($serialized) {
+        return $this->unserialize();
+    }
 }
 
 $o = new Obj(1, 2);
diff --git a/tests/031.phpt b/tests/031.phpt
index ce3a7c4..f178851 100644
--- a/tests/031.phpt
+++ b/tests/031.phpt
@@ -46,6 +46,14 @@ class Obj implements Serializable {
             throw new Exception("exception in unserialize $c");
         }
     }
+
+    public function __serialize() {
+        return $this->serialize();
+    }
+
+    public function __unserialize($serialized) {
+        return $this->unserialize();
+    }
 }
 
 $a = new Obj(1, 0);
diff --git a/tests/042.phpt b/tests/042.phpt
index 83e8bc7..4717a18 100644
--- a/tests/042.phpt
+++ b/tests/042.phpt
@@ -23,6 +23,14 @@ class Foo implements Serializable {
     public function unserialize($str) {
         echo "Should not be run.\n";
     }
+
+    public function __serialize() {
+        return $this->serialize();
+    }
+
+    public function __unserialize($serialized) {
+        return $this->unserialize();
+    }
 }
 
 $array = array($closure, new Foo());

From be01bccf1ddeeb1ef09722bf869c75c463e22bcb Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Fri, 11 Jun 2021 17:36:31 +0200
Subject: [PATCH] proper implementation for __(un)serializ magic methods

---
 tests/021.phpt | 4 ++--
 tests/031.phpt | 4 ++--
 tests/042.phpt | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tests/021.phpt b/tests/021.phpt
index c5cb364..e498382 100644
--- a/tests/021.phpt
+++ b/tests/021.phpt
@@ -40,11 +40,11 @@ class Obj implements Serializable {
     }
 
     public function __serialize() {
-        return $this->serialize();
+        return [$this->serialize()];
     }
 
     public function __unserialize($serialized) {
-        return $this->unserialize();
+        return $this->unserialize($serialized[0]);
     }
 }
 
diff --git a/tests/031.phpt b/tests/031.phpt
index f178851..f149305 100644
--- a/tests/031.phpt
+++ b/tests/031.phpt
@@ -48,11 +48,11 @@ class Obj implements Serializable {
     }
 
     public function __serialize() {
-        return $this->serialize();
+        return [$this->serialize()];
     }
 
     public function __unserialize($serialized) {
-        return $this->unserialize();
+        return $this->unserialize($serialized[0]);
     }
 }
 
diff --git a/tests/042.phpt b/tests/042.phpt
index 4717a18..3c71e9d 100644
--- a/tests/042.phpt
+++ b/tests/042.phpt
@@ -25,11 +25,11 @@ class Foo implements Serializable {
     }
 
     public function __serialize() {
-        return $this->serialize();
+        return [$this->serialize()];
     }
 
     public function __unserialize($serialized) {
-        return $this->unserialize();
+        return $this->unserialize($serialized[0]);
     }
 }