|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-10-10 01:55 UTC] alan at akbkhome dot 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 :)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 07:00:01 2025 UTC |
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