ID: 29985 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Assigned +Status: Open Bug Type: Session related Operating System: Linux, Win32 PHP Version: 5.0.5, 5.1.0RC2-dev -Assigned To: sniper +Assigned To: helly
Previous Comments: ------------------------------------------------------------------------ [2005-10-06 15:40:02] [EMAIL PROTECTED] Yes, it is reproducible: C:\Dokumente und Einstellungen\nohn_s\Desktop\php5.1-win32-200510031830>php test.php object(__PHP_Incomplete_Class)#1 (2) { ["__PHP_Incomplete_Class_Name"]=> string(3) "bar" ["someProp"]=> int(2) } Fatal error: main(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "bar" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in C:\Dokumente und Einstellungen\nohn_s\Desktop\php5.1-win32-200510031830\test.php on line 2 ------------------------------------------------------------------------ [2005-10-06 15:15:23] [EMAIL PROTECTED] Can you reproduce with 5.1-dev? ------------------------------------------------------------------------ [2005-10-06 14:56:58] [EMAIL PROTECTED] Reopening this bug. Could reproduce it with PHP 5.0.5 on WinXP: >type test.php <?php class foo{function someFunc(){} var$someProp=2;}$a=serialize(new foo());$b=str_replace('foo','bar',$a);var_dum p($c = unserialize($b));$c->someFunc(); ?> >php test.php object(__PHP_Incomplete_Class)#1 (2) { ["__PHP_Incomplete_Class_Name"]=> string(3) "bar" ["someProp"]=> int(2) } Fatal error: main(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "bar" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in C:\Dokumente und Einstellungen\nohn_s\Desktop\php-5.0.5\test.php on line 2 ------------------------------------------------------------------------ [2004-09-05 19:46:24] [EMAIL PROTECTED] This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. ------------------------------------------------------------------------ [2004-09-05 14:30:14] [EMAIL PROTECTED] Hmm.. I really don't understand why incomplete_class_message() looks for class_name in EG(This), while class_name is property of the object, which could be easily passed to incomplete_class_message(). So, this patch should probably fix it: http://tony2001.phpclub.net/dev/tmp/bug29985.diff Comments are welcome. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/29985 -- Edit this bug report at http://bugs.php.net/?id=29985&edit=1