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?
    – Wrikken
    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.
    – Scott B
    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.

10
  • @BoltClock I'm pretty sure it will! (Can't test it though, I have no PHp 4's running any more...)
    – Pekka
    Commented Oct 21, 2010 at 17:35
  • @Pekka: OK I ran a test, you're right. I must have been in some parallel universe. +1
    – BoltClock
    Commented Oct 21, 2010 at 17:39
  • 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
    Commented Oct 21, 2010 at 17:43
  • @Scott B if they still use PHP 4, run away screaming. Use phpinfo() to find out
    – Pekka
    Commented Oct 21, 2010 at 17:44
  • How might I add try/catch or error checking on that line to catch it?
    – Scott B
    Commented Oct 21, 2010 at 17:46
1

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.