I am stuck with a php4 server and I need to convert a script from php5 to php4.
I need to convert this code to php4
$response = $this->parent->send('get_content_list', $tail);
Thnx in advance.
UPDATE This is the error I get:
Fatal error: Call to undefined method: stdClass->send()
UPDATE I had a __constructor in the parent class. I've changed it开发者_StackOverflow to the class name and it is OK!
I am stuck with a php4 server and I need to convert a script from php5 to php4.
Get another host. PHP4 is widely considered a liability, it's way past end-of-life, and you're robbing yourself from many handy features which may decrease development time.
$response = $this->parent->send('get_content_list', $tail);
So? There isn't a reason this wouldn't work in PHP4, as long as $this->parent is actually defined and an object? Are you getting any errors?
Use
$response = $this->parent->send('get_content_list', $tail);
If this does not work, tell us the error message that you get. If you do not get any error message and it still does not work, set error_reporting
to E_ALL
and turn on display_errors
If I'm not wrong and guessing from the error, you are trying to call the send()
method of the parent class, right?
If so, then I'm afraid $this->parent
isn't the right way to do so. Try using parent::send()
or you may also use the parent classname instead of the "parent" keyword.
Your statement may though work if $this->parent
points to your parent class.
Hope this helps!
精彩评论