Connecting Tech Pros Worldwide Help | Site Map

What does "PHP_Incomplete_Class" mean?

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 02:15 PM
elektrophyte
Guest
 
Posts: n/a
Default What does "PHP_Incomplete_Class" mean?

I have a class "Form" that I instantiate then put in the SESSION in
order to use it on another page. When I get to the new page, I can't
access any of the fields of the class because they're all NULL. The
weird thing is, in my debugger $_SESSION['myFormInstance'] shows as
having fields not null -- they are filled with the appropriate values.
But when I do

$foo = $_SESSION['myFormInstance'];

then

$foo->someField is NULL.

Also, in the listing of SESSION variables in the debugger, under "Type"
myFormInstance has a type of "object(__PHP_Incomplete_Class)".

Any insight into this would be greatly appreciated.

Thanks,

E


  #2  
Old July 17th, 2005, 02:15 PM
Shelly
Guest
 
Posts: n/a
Default Re: What does "PHP_Incomplete_Class" mean?


"elektrophyte" <elektrophyte@yahoo.com> wrote in message
news:1121341850.437588.185450@g43g2000cwa.googlegr oups.com...[color=blue]
>I have a class "Form" that I instantiate then put in the SESSION in
> order to use it on another page. When I get to the new page, I can't
> access any of the fields of the class because they're all NULL. The
> weird thing is, in my debugger $_SESSION['myFormInstance'] shows as
> having fields not null -- they are filled with the appropriate values.
> But when I do
>
> $foo = $_SESSION['myFormInstance'];
>
> then
>
> $foo->someField is NULL.
>
> Also, in the listing of SESSION variables in the debugger, under "Type"
> myFormInstance has a type of "object(__PHP_Incomplete_Class)".
>
> Any insight into this would be greatly appreciated.
>
> Thanks,
>
> E
>[/color]

OK, I'll ask the obvious: Do you have session_start() right at the top?

Shelly


  #3  
Old July 17th, 2005, 02:15 PM
elektrophyte
Guest
 
Posts: n/a
Default Re: What does "PHP_Incomplete_Class" mean?

Shelly wrote:[color=blue]
>
> OK, I'll ask the obvious: Do you have session_start() right at the top?
>
> Shelly[/color]

Yes.

E

  #4  
Old July 17th, 2005, 02:15 PM
elektrophyte
Guest
 
Posts: n/a
Default Re: What does "PHP_Incomplete_Class" mean?

elektrophyte wrote:
....[color=blue]
> Also, in the listing of SESSION variables in the debugger, under "Type"
> myFormInstance has a type of "object(__PHP_Incomplete_Class)".[/color]

I found out the answer. It's that the class declaration has to be
available before you call session_start(). If your class is defined in
an included file, you have to call include() (include_once(),
require(), require_once()) before you call session_start().

E

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.