Solved

get_class() called without object from outside a class

Posted on 2011-03-03
8
1,041 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

758 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

17 Experts available now in Live!

Get 1:1 Help Now