Doc #60929 [Opn->Nab]: Serializable::unserialize() returns "void"
| From: | frozenfire@php.net | Date: | Mon, 30 Jan 2012 02:43:18 +0000 |
| Subject: | Doc #60929 [Opn->Nab]: Serializable::unserialize() returns "void" | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-7886@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=60929&edit=1
ID: 60929
Updated by: frozenfire@php.net
Reported by: salsi at icosaedro dot it
Summary: Serializable::unserialize() returns "void"
-Status: Open
+Status: Not a bug
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Serializable::unserialize() returns the unserialized object. Thus, the type is
mixed, because the returned object can be of any class type.
void would suggest that the call to unserialize() would not return any value.
That would be the case if the syntax for unserialize() were unserialize($string,
&$result). But, that's not the case.
Previous Comments:
------------------------------------------------------------------------
[2012-01-29 23:05:22] salsi at icosaedro dot it
Description:
------------
---
From manual page: http://www.php.net/serializable.unserialize#refsect1-serializable.unserialize-returnvalues
---
Serializable::unserialize() does not return "mixed", it does not return anything at all as
one can see from the examples, because unserialize() is called instead of __construct(). The formal
return type should then be "void".
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60929&edit=1