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
Solved

get_class() called without object from outside a class

Posted on 2011-03-03
8
1,080 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

Question has a verified solution.

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

Suggested Solutions

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.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

838 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