Mobile app version of vmapp.org
Login or Join
Murray155

: PhpMyAdmin unexpected T_OBJECT_OPERATOR error I tried to install phpMyAdmin on a customers webserver. Suddenly I get this error: Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /homepages/29/d104628985/htdocs/*****-

@Murray155

Posted in: #Error #Phpmyadmin

I tried to install phpMyAdmin on a customers webserver. Suddenly I get this error:


Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /homepages/29/d104628985/htdocs/*****-*****/phpMyAdmin/index.php on line 53


I did not change anything in the files of phpMyAdmin. At last I found that somebody deleted the php.ini from the directory. Can be this the reason for the error?

This is the block with line 53 (the sixth line).

require_once 'libraries/RecentTable.class.php';
if ($GLOBALS['is_ajax_request'] && ! empty($_REQUEST['recent_table'])) {
$response = PMA_Response::getInstance();
$response->addJSON(
'options',
PMA_RecentTable::getInstance()->getHtmlSelectOption()
);
exit;
}

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Murray155

1 Comments

Sorted by latest first Latest Oldest Best

 

@Ann8826881

I suspected this was caused by running a (very) old version of PHP. (It seems PHP 4.2 was installed on the server).

The reported "Parse error" is a fundamental syntax error at compile time. Any other problems such as libraries not being found or errors during object instantiation (at runtime) would have resulted in different errors/warnings. However, there is nothing syntactically wrong with the above code in PHP5.

It would seem that calling a method directly on a function's return value is not supported in PHP4's OOP model*. (In fact, there have been further improvements with respect to the object/arrow operator in PHP 5.4, allowing methods to be called directly on object instantiation.)

*Although I can't find specific mention of this as a "new feature" in the PHP5 changelog.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme