Solved

get_class() called without object from outside a class

Posted on 2011-03-03
8
1,054 Views
Last Modified: 2012-05-11
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?
0
Comment
Question by:Unimatrix_001
  • 4
  • 3
8 Comments
 
LVL 36

Accepted Solution

by:
Loganathan Natarajan earned 500 total points
ID: 35026336
have you created object called,

$mCurrentCell =  new someclass();
0
 
LVL 3

Author Comment

by:Unimatrix_001
ID: 35026347
Yes, infact if I have the following:

echo($mCurrentCell);

I get:

Object of class CElement could not be converted to string
0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 35026363
can u give more details of error
0
 
LVL 3

Author Comment

by:Unimatrix_001
ID: 35026369
Happily... although I'm not quite sure what else I can put? Do you mean code?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 35026520
i mean the error "Got a bit of a cryptic error message here." ??
0
 
LVL 3

Author Comment

by:Unimatrix_001
ID: 35026522
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
 
LVL 3

Author Closing Comment

by:Unimatrix_001
ID: 35026698
Found the issue and this was very related! :)
0
 
LVL 13

Expert Comment

by:darren-w-
ID: 35026729
Perhaps try this:



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

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now