ID:               19842
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 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] [EMAIL PROTECTED]

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

Reply via email to