php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #60929 Serializable::unserialize() returns "void"
Submitted: 2012-01-29 23:05 UTC Modified: 2012-01-30 12:40 UTC
From: salsi at icosaedro dot it Assigned: aharvey (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: salsi at icosaedro dot it
New email:
PHP Version: OS:

 

 [2012-01-29 23:05 UTC] 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".


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-01-30 02:43 UTC] frozenfire@php.net
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.
 [2012-01-30 02:43 UTC] frozenfire@php.net
-Status: Open +Status: Not a bug
 [2012-01-30 12:31 UTC] aharvey@php.net
Actually, the return values section of that page is plain wrong too. The return 
value is actually ignored completely.

Reopening; will fix up.
 [2012-01-30 12:31 UTC] aharvey@php.net
-Status: Not a bug +Status: Re-Opened -Assigned To: +Assigned To: aharvey
 [2012-01-30 12:40 UTC] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&revision=322932
Log: Fix doc bug #60929 (Serializable::unserialize() returns "void").
 [2012-01-30 12:40 UTC] aharvey@php.net
-Status: Re-Opened +Status: Closed
 [2012-01-30 12:40 UTC] aharvey@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 17:00:02 2026 UTC