1

I have a parent class, that calls a new facebook class within it. However, I then have another class that extends the parent, and tries to read the facebook class within it, but it dies everytime.

Any ideas?

Thanks!

2
  • also what error message does it issue when failing? Commented Mar 7, 2011 at 2:34
  • See Mr. Yang's response below, he hit it on the dot. Commented Mar 7, 2011 at 2:51

1 Answer 1

4

My psychic debugging skills tell me that your subclass is not calling the parent constructor, so the facebook class is not being created.

If you're in PHP5, try adding parent::__construct(); to the subclass's constructor, possibly with some extra parameters. Otherwise, you might need to do: $this->SuperclassName(); with some extra parameters as well.

Sign up to request clarification or add additional context in comments.

11 Comments

+1 for psychic debugging skills. Wish I had some too but I'm stuck with xdebug and var_dump()
+1 for psychic debugging skills and hinting the parent constructor call, I need to learn psychic debugging skills
So far no go yet sadly. I added the parent class construct, but that didn't go through. I have a few more ideas that kicked into my mind.
What test did you conduct to determine my answer was correct?
from within the new class under the primary class, i set it to parent::__construct(), which just died too. I however set it to extend the primary class, which didn't die, but still could not be called from the class that extended the primary
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.