php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12188 Object with Sessiona
Submitted: 2001-07-16 11:19 UTC Modified: 2002-01-09 02:04 UTC
From: wedro at gmx dot net Assigned:
Status: Closed Package: Session related
PHP Version: 4.0.6 OS:
Private report: No CVE-ID: None
 [2001-07-16 11:19 UTC] wedro at gmx dot net
  class A {
      var $a;
      function add(){
        $this->a++;
      }
    }
      session_register('a');
       if (!is_object($a)){
       $a = new A();
     }
     $a->add();
     print_r($a);

========================================================================================================================

Modules :

"./configure" \
"--with-iconv" \
"--with-mysql" \
"--with-apxs=/usr/local/apache/bin/apxs" \
"--with-xml" \
"--with-sablot" \
"--with-swf=/usr/local/src/dist" \
"-enable-sysvsem" \
"-enable-sysvshm" \
"-enable-trans-sid" \
"-enable-track-vars" \
"-enable-register-globals" \
"$@"

============================================================

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-16 11:37 UTC] hholzgra@php.net
... and the problem is ... ?
 [2001-07-16 16:03 UTC] wedro at gmx dot net
Fatal error: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition stati of the object you are trying to operate on was loaded _before_ the session was started in /var/www/wedr0/test/para4.php on line 12


 [2001-07-16 16:23 UTC] cmv@php.net
This works perfectly for me.  If I keep reloading that page I get:

a Object ( [a] => 1 ) 

a Object ( [a] => 2 ) 

a Object ( [a] => 3 ) 

a Object ( [a] => 4 ) 

...


- Colin
 [2001-07-17 05:06 UTC] wedro at gmx dot net
what is my error then ?
 [2001-08-20 12:16 UTC] sniper@php.net
status->open

 [2001-12-19 22:14 UTC] yohgaki@php.net
Please test with 4.1.0 and latest CVS snapshot.
CVS snapshot can be found 
http://snaps.php.net/

If you don't have problem with latest CVS snapshot,
you can close your bug report by yourself.

Please report the result. When you update your bug
report, do not forget updating PHP version also.

Thank you
-- 
Yasuo
 [2002-01-09 02:04 UTC] lobbin@php.net
No feedback. Closing.
 [2003-04-20 15:37 UTC] admin at webctr dot com
I am getting this error, too. 4.1.0 using osCommerce under SuSe 8.0 Linux.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 07:01:28 2024 UTC