Doc #60929 [Nab->ReO]: Serializable::unserialize() returns "void"

From: Date: Mon, 30 Jan 2012 12:31:00 +0000
Subject: Doc #60929 [Nab->ReO]: Serializable::unserialize() returns "void"
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-7887@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: aharvey@php.net Reported by: salsi at icosaedro dot it Summary: Serializable::unserialize() returns "void" -Status: Not a bug +Status: Re-Opened Type: Documentation Problem Package: Documentation problem PHP Version: Irrelevant -Assigned To: +Assigned To: aharvey Block user comment: N Private report: N New Comment: Actually, the return values section of that page is plain wrong too. The return value is actually ignored completely. Reopening; will fix up. Previous Comments: ------------------------------------------------------------------------ [2012-01-30 02:43:18] 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-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

« previous php.doc.bugs (#7887) next »