#36422 [Opn]: unserialize() __autoloads invalid objects

From: Date: Thu, 16 Feb 2006 19:59:08 +0000
Subject: #36422 [Opn]: unserialize() __autoloads invalid objects
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969371960@lists.php.net to get a copy of this message
ID: 36422 Updated by: tony2001@php.net Reported By: tomas_matousek at hotmail dot com Status: Open -Bug Type: Class/Object related +Bug Type: Documentation problem Operating System: WinXP PHP Version: 5.1.2 New Comment: This is expected, as object of __PHP_Incomplete_Class is actually not valid object. Reclassified as docu problem. Previous Comments: ------------------------------------------------------------------------ [2006-02-16 20:36:56] tomas_matousek at hotmail dot com Description: ------------ When unserialize calls __autoload() and this dosn't load the required class unserialize returns an object that doesn't behave like object; var_dump displays it as an object but is_object gives false. Reproduce code: --------------- function __autoload($class_name) { } var_dump($o = unserialize('O:1:"X":0:{}')); var_dump(is_object($o)); Expected result: ---------------- object(__PHP_Incomplete_Class)#1 (1) { ["__PHP_Incomplete_Class_Name"]=> string(1) "X" } bool(true) Actual result: -------------- object(__PHP_Incomplete_Class)#1 (1) { ["__PHP_Incomplete_Class_Name"]=> string(1) "X" } bool(false) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36422&edit=1

« previous php.doc (#969371960) next »