PHP issue - T_OBJECT_OPERATOR

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

PHP issue - T_OBJECT_OPERATOR

Post by Jonah Bron »

Hi,

I have some PHP code that works perfectly on my localhost (PHP5) but produces an error on my server (also PHP5):

Parse error: parse error, unexpected T_OBJECT_OPERATOR in /doc.php on line 60

This page is included by another page, which is included by another page:

mainpage ->include secondpage
secondpage ->include doc.php

Soooo, two questions. Why does it not work on my server, and, more importantly: what is a T_OBJECT_OPERATOR?

Help much appreciated.

Here is an excerpt of the code:

Code: Select all

57 | $pages = $doc->getElementsByTagName( "page" );
58 | foreach( $pages as $page ){
59 | $names = $page->getElementsByTagName( "name" );
>>60 | $name = $names->item(0)->nodeValue;<<
Post Reply