This commit is contained in:
as2252258@163.com
2021-03-26 01:52:36 +08:00
parent c4dc78eeff
commit c09a4cc306
+8 -8
View File
@@ -671,11 +671,11 @@ if (!function_exists('swoole_serialize')) {
*/ */
function swoole_serialize($data): string function swoole_serialize($data): string
{ {
if (class_exists('swoole_serialize')) { // if (class_exists('swoole_serialize')) {
return \swoole_serialize::pack($data); // return \swoole_serialize::pack($data);
} else { // } else {
return serialize($data); return serialize($data);
} // }
} }
} }
@@ -693,11 +693,11 @@ if (!function_exists('swoole_unserialize')) {
if (empty($data)) { if (empty($data)) {
return null; return null;
} }
if (class_exists('swoole_serialize')) { // if (class_exists('swoole_serialize')) {
return \swoole_serialize::unpack($data); // return \swoole_serialize::unpack($data);
} else { // } else {
return unserialize($data); return unserialize($data);
} // }
} }
} }