0

The code below is part of an rss feed parser using WordPress's simplepie fetch_feed()...

Code is:

    if ($enclosure = $item->get_enclosure(0))
    {
    $image_thumb = $item->get_enclosure()->get_link().'screenshot.jpg';
    $image = $item->get_enclosure()->get_link().'screenshot-full.jpg';
    }
    $link = esc_url( strip_tags( $item->get_link() ) );
    $content = $item->get_content();

Upon trying to activate the theme in which this code appears, I'm getting the following error:

Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/.../functions.php on line 1341

Line 1341 is the line that starts with $image_thumb

2
  • Are you by any chance still using ancient PHP4? Commented Oct 21, 2010 at 17:33
  • The owner of this site is on Godaddy and apparently they do in fact use PHP4.x on his server. Commented Oct 21, 2010 at 18:18

2 Answers 2

3

My wild guess is that this is PHP 4, which doesn't support method chaining.

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

10 Comments

@BoltClock I'm pretty sure it will! (Can't test it though, I have no PHp 4's running any more...)
@Pekka: OK I ran a test, you're right. I must have been in some parallel universe. +1
Site is on a godaddy server using their WordPress 3.0.1 installer. I would expect their default PHP install to be fairly new but I will have a check...
@Scott B if they still use PHP 4, run away screaming. Use phpinfo() to find out
How might I add try/catch or error checking on that line to catch it?
|
1

Yes Its PHP 4 it doesn't support multi method access in single

Comments

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.