get_class() called without object from outside a class

Hello,

Got a bit of a cryptic error message here... Seems this is the line:

...
}else if(get_class($mCurrentCell)=="CElement"){
...
}

Open in new window


What could cause this?
LVL 3
Unimatrix_001Asked:
Who is Participating?
 
Loganathan NatarajanConnect With a Mentor LAMP DeveloperCommented:
have you created object called,

$mCurrentCell =  new someclass();
0
 
Unimatrix_001Author Commented:
Yes, infact if I have the following:

echo($mCurrentCell);

I get:

Object of class CElement could not be converted to string
0
 
Loganathan NatarajanLAMP DeveloperCommented:
can u give more details of error
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Unimatrix_001Author Commented:
Happily... although I'm not quite sure what else I can put? Do you mean code?
0
 
Loganathan NatarajanLAMP DeveloperCommented:
i mean the error "Got a bit of a cryptic error message here." ??
0
 
Unimatrix_001Author Commented:
Ah, that would be the subject...

get_class() called without object from outside a class

Seems completely meaningless, as an object is getting passed into get_class.

Thanks,
Uni
0
 
Unimatrix_001Author Commented:
Found the issue and this was very related! :)
0
 
darren-w-Commented:
Perhaps try this:



else if(get_class($mCurrentCell) != false){

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.