#19842 [Opn]: is_object returns FALSE on Incomplete classes

From: Date: Thu, 10 Oct 2002 07:13:17 +0000
Subject: #19842 [Opn]: is_object returns FALSE on Incomplete classes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-22017@lists.php.net to get a copy of this message
ID: 19842 Updated by: alan_k@php.net Reported By: alan@akbkhome.com Status: Open Bug Type: Class/Object related Operating System: linux PHP Version: 4CVS-2002-10-10 New Comment: variable object variables also fail on incomplete classes: eg. (from the example below) $data = unserialize(file_get_contents('/tmp/test')); $key = 't'; var_dump($data->$key); // is blank. //however $ar = get_object_vars($data); echo $ar[$key]; // produces 1 Previous Comments: ------------------------------------------------------------------------ [2002-10-10 01:55:22] alan@akbkhome.com Steps to reproduce a) generate a serialized class eg. class atest { var $t = 1; } $t = new atest; $fh = fopen('/tmp/test','w'); fwrite($fh,serialize($t)); fclose($fh); ---------------------- In another file $data = unserialize(file_get_contents('/tmp/test')); if (!is_object($data)) { echo "DATA is an ".gettype($b)."!\n"; } } ---- should output DATA is an object! It's on the verge of expected behaviour, but it would be nice if it worked :) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=19842&edit=1

« previous php.bugs (#22017) next »