?
Solved

get_class() called without object from outside a class

Posted on 2011-03-03
8
Medium Priority
?
1,152 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 36

Accepted Solution

by:
Loganathan Natarajan earned 2000 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
WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

 
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
 
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

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

777 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