Parse error syntax error unexpected t object operator

I got this error when debugging my code: PHP Parse error: syntax error, unexpected T_OBJECT_OPERATOR in order.php on line 72 Here is a snippet of the code (starting on line 72): $purchaseOrde...

I got this error when debugging my code:

PHP Parse error: syntax error, unexpected T_OBJECT_OPERATOR in order.php on line 72

Here is a snippet of the code (starting on line 72):

$purchaseOrder = new PurchaseOrderFactory->instance();
$arrOrderDetails = $purchaseOrder->load($customerName);

ReinstateMonica3167040's user avatar

asked Nov 14, 2012 at 22:33

user1825110's user avatar

0

Unfortunately, it is not possible to call a method on an object just created with new before PHP 5.4.

In PHP 5.4 and later, the following can be used:

$purchaseOrder = (new PurchaseOrderFactory)->instance();

Note the mandatory pair of parenthesis.

In previous versions, you have to call the method on a variable:

$purchaseFactory = new PurchaseOrderFactory;
$purchaseOrder = $purchaseFactory->instance();

answered Nov 14, 2012 at 22:36

SirDarius's user avatar

SirDariusSirDarius

40.5k8 gold badges84 silver badges100 bronze badges

1

change to as your syntax was invalid:

$purchaseOrder = PurchaseOrderFactory::instance();
$arrOrderDetails = $purchaseOrder->load($customerName);

where presumably instance() creates an instance of the class. You can do this rather than saying new

answered Nov 14, 2012 at 22:34

Samuel Cook's user avatar

Samuel CookSamuel Cook

16.4k6 gold badges50 silver badges62 bronze badges

1

You can’t use (it’s invalid php syntax):

new PurchaseOrderFactory->instance();

You probably meant one of those:

// Initialize new object of class PurchaseOrderFactory
new PurchaseOrderFactory(); 

// Clone instance of already existing PurchaseOrderFactory
clone  PurchaseOrderFactory::instance();

// Simply use one instance
PurchaseOrderFactory::instance();

// Initialize new object and that use one of its methods
$tmp = new PurchaseOrderFactory();
$tmp->instance();

answered Nov 14, 2012 at 22:35

Vyktor's user avatar

VyktorVyktor

20.4k6 gold badges62 silver badges96 bronze badges

Различные части языка PHP внутренне представлены токенами.
Фрагмент кода, содержащий недопустимую последовательность токенов, может привести к таким ошибкам, как Parse error: syntax error, unexpected token "==", expecting "(" in script.php on line 10.",
где токен == внутренне представлен как T_IS_EQUAL.

В следующей таблице перечислены все токены. Они также доступны как константы PHP.

Замечание:
Использование T_* констант

Значения T_* констант автоматически генерируются на основе базовой инфраструктуры синтаксического анализатора PHP.
Это означает, что конкретное значение метки может изменяться
между двумя версиями PHP.
Это означает, что ваш код никогда не должен напрямую полагаться
на исходные значения T_*, взятые из версии PHP X.Y.Z,
чтобы обеспечить некоторую совместимость между несколькими версиями PHP.

Чтобы использовать T_* константы в нескольких версиях PHP, неопределённые константы
могут быть определены пользователем (с использованием больших чисел, таких как 10000)
с соответствующей стратегией, которая будет работать как с версиями PHP, так и со значениями T_*.


<?php
// До PHP 7.4.0 значение T_FN не определено.
defined('T_FN') || define('T_FN', 10001);

Метки

Метка Синтаксис Ссылка
T_ABSTRACT abstract Абстрактные классы
T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG & Объявление типов (доступно, начиная с PHP 8.1.0)
T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG & Объявление типов (доступно, начиная с PHP 8.1.0)
T_AND_EQUAL &= операторы присваивания
T_ARRAY array() array(), синтаксис массива
T_ARRAY_CAST (array) приведение типа
T_AS as foreach
T_ATTRIBUTE #[ attributes (доступно с PHP 8.0.0)
T_BAD_CHARACTER   все, что ниже ASCII 32 исключая t (0x09), n (0x0a) и r (0x0d)
(доступно с PHP 7.4.0)
T_BOOLEAN_AND && логические операторы
T_BOOLEAN_OR || логические операторы
T_BOOL_CAST (bool) или (boolean) приведение типа
T_BREAK break break
T_CALLABLE callable callable
T_CASE case switch
T_CATCH catch Исключения
T_CLASS class классы и объекты
T_CLASS_C __CLASS__ магические константы
T_CLONE clone классы и объекты
T_CLOSE_TAG ?> или %> PHP-код внутри HTML
T_COALESCE ?? операторы сравнения
T_COALESCE_EQUAL ??= операторы присваивания
(доступно с PHP 7.4.0)
T_COMMENT // или #, и /* */ комментарии
T_CONCAT_EQUAL .= операторы присваивания
T_CONST const константы класса
T_CONSTANT_ENCAPSED_STRING «foo» или ‘bar’ строковой синтаксис
T_CONTINUE continue continue
T_CURLY_OPEN {$ переменные внутри строки
T_DEC операторы инкрементадекремента
T_DECLARE declare declare
T_DEFAULT default switch
T_DIR __DIR__ магические константы
T_DIV_EQUAL /= операторы присваивания
T_DNUMBER 0.12 и т.д. числа с плавающей точкой
T_DO do do..while
T_DOC_COMMENT /** */ PHPDoc-комментарии
T_DOLLAR_OPEN_CURLY_BRACES ${ переменная внутри строки
T_DOUBLE_ARROW => синтаксис массивов
T_DOUBLE_CAST (real), (double) или (float) приведение типов
T_DOUBLE_COLON :: смотрите ниже T_PAAMAYIM_NEKUDOTAYIM
T_ECHO echo echo
T_ELLIPSIS аргументы функции
T_ELSE else else
T_ELSEIF elseif elseif
T_EMPTY empty empty()
T_ENCAPSED_AND_WHITESPACE » $a» константная часть строки с переменными
T_ENDDECLARE enddeclare declare, альтернативный синтаксис
T_ENDFOR endfor for, альтернативный синтаксис
T_ENDFOREACH endforeach foreach, альтернативный синтаксис
T_ENDIF endif if, альтернативный синтаксис
T_ENDSWITCH endswitch switch, альтернативный синтаксис
T_ENDWHILE endwhile while, альтернативный синтаксис
T_ENUM enum Перечисления (доступно, начиная с PHP 8.1.0)
T_END_HEREDOC   синтаксис heredoc
T_EVAL eval() eval()
T_EXIT exit или die exit(), die()
T_EXTENDS extends extends, классы и объекты
T_FILE __FILE__ магические константы
T_FINAL final Ключевое слово final
T_FINALLY finally Исключения
T_FN fn стрелочные функции
(доступно с PHP 7.4.0)
T_FOR for for
T_FOREACH foreach foreach
T_FUNCTION function функции
T_FUNC_C __FUNCTION__ магические константы
T_GLOBAL global область видимости переменной
T_GOTO goto goto
T_HALT_COMPILER __halt_compiler() __halt_compiler
T_IF if if
T_IMPLEMENTS implements Интерфейсы объектов
T_INC ++ операторы инкрементадекремента
T_INCLUDE include() include
T_INCLUDE_ONCE include_once() include_once
T_INLINE_HTML   текст вне PHP
T_INSTANCEOF instanceof операторы типа
T_INSTEADOF insteadof Трейты
T_INTERFACE interface Интерфейсы объектов
T_INT_CAST (int) или (integer) приведение типов
T_ISSET isset() isset()
T_IS_EQUAL == операторы сравнения
T_IS_GREATER_OR_EQUAL >= операторы сравнения
T_IS_IDENTICAL === операторы сравнения
T_IS_NOT_EQUAL != или <> операторы сравнения
T_IS_NOT_IDENTICAL !== операторы сравнения
T_IS_SMALLER_OR_EQUAL <= операторы сравнения
T_LINE __LINE__ магические константы
T_LIST list() list()
T_LNUMBER 123, 012, 0x1ac и т.д. целые числа
T_LOGICAL_AND and логические операторы
T_LOGICAL_OR or логические операторы
T_LOGICAL_XOR xor логические операторы
T_MATCH match match (доступно с PHP 8.0.0)
T_METHOD_C __METHOD__ магические константы
T_MINUS_EQUAL -= операторы присваивания
T_MOD_EQUAL %= операторы присваивания
T_MUL_EQUAL *= операторы присваивания
T_NAMESPACE namespace пространства имён
T_NAME_FULLY_QUALIFIED AppNamespace пространства имён (доступно, начиная с PHP 8.0.0)
T_NAME_QUALIFIED AppNamespace пространства имён (доступно, начиная с PHP 8.0.0)
T_NAME_RELATIVE namespaceNamespace пространства имён (доступно, начиная с PHP 8.0.0)
T_NEW new классы и объекты
T_NS_C __NAMESPACE__ пространства имён
T_NS_SEPARATOR пространства имён
T_NUM_STRING «$a[0]» цифровой индекс массива внутри строки
T_OBJECT_CAST (object) приведение типов
T_OBJECT_OPERATOR -> классы и объекты
T_NULLSAFE_OBJECT_OPERATOR ?-> классы и объекты
T_OPEN_TAG <?php, <? или <% PHP-код внутри HTML
T_OPEN_TAG_WITH_ECHO <?= или <%= PHP-код внутри HTML
T_OR_EQUAL |= операторы
присваивания
T_PAAMAYIM_NEKUDOTAYIM :: ::. Также определяется как
T_DOUBLE_COLON.
T_PLUS_EQUAL += операторы
присваивания
T_POW ** арифметические операторы
T_POW_EQUAL **= операторы присваивания
T_PRINT print() print
T_PRIVATE private классы и объекты
T_PROTECTED protected классы и объекты
T_PUBLIC public классы и объекты
T_READONLY readonly классы и объекты (доступно, начиная с PHP 8.1.0)
T_REQUIRE require() require
T_REQUIRE_ONCE require_once() require_once
T_RETURN return возвращаемые значения
T_SL << побитовые операторы
T_SL_EQUAL <<= операторы присваивания
T_SPACESHIP <=> Операторы сравнения
T_SR >> побитовые операторы
T_SR_EQUAL >>= операторы присваивания
T_START_HEREDOC <<< синтаксис heredoc
T_STATIC static область видимости переменной
T_STRING parent, self и т.п.. идентификаторы, например, ключевые слова вроде parent и self,
сюда подходят также имена функций, классов и некоторые другие.
Смотрите также T_CONSTANT_ENCAPSED_STRING
T_STRING_CAST (string) приведение типов
T_STRING_VARNAME «${a переменные внутри строки
T_SWITCH switch switch
T_THROW throw Исключения
T_TRAIT trait Трейты
T_TRAIT_C __TRAIT__ __TRAIT__
T_TRY try Исключения
T_UNSET unset() unset()
T_UNSET_CAST (unset) приведение типов
T_USE use пространства имён
T_VAR var классы и объекты
T_VARIABLE $foo переменные
T_WHILE while while, do..while
T_WHITESPACE t rn  
T_XOR_EQUAL ^= операторы
присваивания
T_YIELD yield генераторы
T_YIELD_FROM yield from generators

Смотрите также token_name().

nathan at unfinitydesign dot com

14 years ago


T_ENCAPSED_AND_WHITESPACE is whitespace which intersects a group of tokens. For example, an "unexpected T_ENCAPSED_AND_WHITESPACE" error is produced by the following code:

<?php

$main_output_world
= 'snakes!';

echo(
'There are' 10 $main_output_world);

?>



Note the missing concatenation operator between the two strings leads to the whitespace error that is so named above. The concatenation operator instructs PHP to ignore the whitespace between the two code tokens (the so named "encapsed" data"), rather than parse it as a token itself.

The correct code would be:

<?php

$main_output_world
= 'snakes!';

echo(
'There are' . 10 . $main_output_world);

?>



Note the addition of the concatenation operator between each token.


fgm at osinet dot fr

14 years ago


T_ENCAPSED_AND_WHITESPACED is returned when parsing strings with evaluated content, like "some $value" or this example from the Strings reference page:

<?php
echo <<<EOT
My name is "$name". I am printing some $foo->foo.
Now, I am printing some
{$foo->bar[1]}.
This should print a capital 'A': x41
EOT;
?>

This last example is tokenized as:
T_ECHO
  echo
T_WHITESPACE
  %20 (a space character)
T_START_HEREDOC
  <<
T_ENCAPSED_AND_WHITESPACE
  My name is "
T_VARIABLE
  $name
T_ENCAPSED_AND_WHITESPACE   
  ". I am printing some
T_VARIABLE   
  $foo
T_OBJECT_OPERATOR   
  ->
T_STRING   
  foo
T_ENCAPSED_AND_WHITESPACE   
  . Now, I am printing some
T_CURLY_OPEN   
  {
T_VARIABLE   
  $foo
T_OBJECT_OPERATOR   
  ->
T_STRING   
  bar
(terminal)
  [
T_LNUMBER   
  1
(terminal)
  ]
(terminal)
  }
T_ENCAPSED_AND_WHITESPACE   
  . This should print a capital 'A': x41
T_END_HEREDOC
  EOT
(terminal)
  ;


I got this error when debugging my code:

PHP Parse error: syntax error, unexpected T_OBJECT_OPERATOR in order.php on line 63

Here is a snippet of the code (starting on line 63):

$purchaseOrder = new PurchaseOrderFactory->instance();
$arrOrderDetails = $purchaseOrder->load($customerName);







May 19, 2020


in PHP


by



• 37,510 points





3,567 views



1 answer to this question.

Hello @kartik,

Change your syntax because it  was invalid.

Updated syntax:

$purchaseOrder = PurchaseOrderFactory::instance();
$arrOrderDetails = $purchaseOrder->load($customerName);

where presumably instance() creates an instance of the class. You can do this rather than saying new.

Thank You!!






answered

May 19, 2020


by
Niroj


• 82,840 points



Related Questions In PHP

  • All categories

  • ChatGPT
    (4)

  • Apache Kafka
    (84)

  • Apache Spark
    (596)

  • Azure
    (131)

  • Big Data Hadoop
    (1,907)

  • Blockchain
    (1,673)

  • C#
    (141)

  • C++
    (271)

  • Career Counselling
    (1,060)

  • Cloud Computing
    (3,446)

  • Cyber Security & Ethical Hacking
    (147)

  • Data Analytics
    (1,266)

  • Database
    (855)

  • Data Science
    (75)

  • DevOps & Agile
    (3,575)

  • Digital Marketing
    (111)

  • Events & Trending Topics
    (28)

  • IoT (Internet of Things)
    (387)

  • Java
    (1,247)

  • Kotlin
    (8)

  • Linux Administration
    (389)

  • Machine Learning
    (337)

  • MicroStrategy
    (6)

  • PMP
    (423)

  • Power BI
    (516)

  • Python
    (3,188)

  • RPA
    (650)

  • SalesForce
    (92)

  • Selenium
    (1,569)

  • Software Testing
    (56)

  • Tableau
    (608)

  • Talend
    (73)

  • TypeSript
    (124)

  • Web Development
    (3,002)

  • Ask us Anything!
    (66)

  • Others
    (1,938)

  • Mobile Development
    (263)

Subscribe to our Newsletter, and get personalized recommendations.

Already have an account? Sign in.

Moderator: General Support Moderators

jaw5623

Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Tue Aug 17, 2010 6:26 am
Location: Jeddah, Saudi Arabia

[SOLVED] syntax error, unexpected T_OBJECT_OPERATOR

Hello everyone,

I am fairly new to Joomla! and have been working on setting up a site for the last few days. As luck would have it, right after I had finished putting the final touches on everything, I went in and mass activated the plugins (a bad idea?) and now the site has completely crashed. So, now whenever I try to get to any page on the site (front end or back end), I get the following:

Parse error: syntax error, unexpected T_OBJECT_OPERATOR in …/plugins/system/mtupgrade/behavior.php on line 52

I went in and looked at line 52 of behavior.php and it reads (in bold):

}

// If no debugging value is set, use the setting from the application configuration.
if ($debug === null) {
$debug = JFactory::getConfig()->getValue(‘config.debug’);
}

Does anyone have any idea what this problem is and — more importantly — how to resolve it? Also, in case I need to reinstall Joomla! (please don’t let it be so), is there a way to back-up all the articles that I had worked on (ideally with the formatting)?

Thank you for your help!

Sincerely,

Jacques

Last edited by jaw5623 on Tue Aug 17, 2010 10:16 am, edited 2 times in total.


User avatar

Per Yngve Berg

Joomla! Master
Joomla! Master
Posts: 29661
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: syntax error, unexpected T_OBJECT_OPERATOR

Post

by Per Yngve Berg » Tue Aug 17, 2010 6:51 am

Use PhpMyadmin and goto the table jos_plugins and set published=0 on the plugin


jaw5623

Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Tue Aug 17, 2010 6:26 am
Location: Jeddah, Saudi Arabia

Re: syntax error, unexpected T_OBJECT_OPERATOR

Post

by jaw5623 » Tue Aug 17, 2010 7:31 am

Per Yngve Berg wrote:Use PhpMyadmin and goto the table jos_plugins and set published=0 on the plugin

Hello and thank you so much for the quick reply!

I have logged on to phpMyAdmin and I found the jos_plugins table. I have searched around a bit, but I am not where to set published=0. I am attaching a screen shot for your reference.

Thanks again.

Jacques

Last edited by jaw5623 on Tue Aug 17, 2010 8:19 am, edited 1 time in total.



jaw5623

Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Tue Aug 17, 2010 6:26 am
Location: Jeddah, Saudi Arabia

Re: syntax error, unexpected T_OBJECT_OPERATOR

Post

by jaw5623 » Tue Aug 17, 2010 8:25 am

Per Yngve Berg wrote:Click the browse tab!

Aha! It was the «System — Mootools Upgrade» plugin that crashed everything.

Thank you again so much for your help!

Best regards,

Jacques


sony1980

Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Sep 24, 2010 9:30 pm

Re: [SOLVED] syntax error, unexpected T_OBJECT_OPERATOR

Post

by sony1980 » Fri Sep 24, 2010 9:37 pm

hello

I have the same problem

but I haved installed joomla on the server (alfahosting) how can I see the table jos_plugin? I only know how to use phpmyadmin locally..please help


User avatar

Per Yngve Berg

Joomla! Master
Joomla! Master
Posts: 29661
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: [SOLVED] syntax error, unexpected T_OBJECT_OPERATOR

Post

by Per Yngve Berg » Sat Sep 25, 2010 8:40 am

phpmyadmin is usually available in your hosts cpanel. If not, ask your host.


sony1980

Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Sep 24, 2010 9:30 pm

Re: [SOLVED] syntax error, unexpected T_OBJECT_OPERATOR

Post

by sony1980 » Sat Sep 25, 2010 2:18 pm

thank you so much, but i have another question before I do anything wrong.
I wrote SELECT *
FROM `jos_plugins`
WHERE published !=0
I have got 24 datasets : eg. names = Authentifikation — Joomla, Authentifikation — LDAP, .. System — SEF should I set in all of them published=0

sorry, but I want to be sure before I do another mistake..


User avatar

Per Yngve Berg

Joomla! Master
Joomla! Master
Posts: 29661
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: [SOLVED] syntax error, unexpected T_OBJECT_OPERATOR

Post

by Per Yngve Berg » Sat Sep 25, 2010 9:21 pm

You cannot unpublish al of them. If you unpublish the Authentication — Joomla, you will not be able to login.


bigone5500

Joomla! Intern
Joomla! Intern
Posts: 78
Joined: Wed Nov 17, 2010 9:29 pm

Re: [SOLVED] syntax error, unexpected T_OBJECT_OPERATOR

Post

by bigone5500 » Tue Nov 23, 2010 12:35 am

Thanks for this thread!

However I am wondering why enabling this plugin crashes joomla. Is there a reason? Is there a fix?


ShannonMCD

Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Nov 10, 2010 5:43 am

Re: [SOLVED] syntax error, unexpected T_OBJECT_OPERATOR

Post

by ShannonMCD » Sun Nov 28, 2010 9:44 am

had same problem now fixed thanks to this information so wanted to say thanks..

So Thanks alot…


the-javier

Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Dec 23, 2010 5:18 pm

Re: [SOLVED] syntax error, unexpected T_OBJECT_OPERATOR

Post

by the-javier » Thu Dec 23, 2010 5:23 pm

excuse ……
I have the same problem (Parse error: syntax error, unexpected T_OBJECT_OPERATOR in … / plugins / system / mtupgrade / behavior.php on line 52).
I can only come to my site by ftp. how can I fix my mistake through FTP?
I appreciate any help from you ….


User avatar

abernyte

Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4160
Joined: Fri May 15, 2009 2:01 pm
Location: Écosse — Scozia — Escocia — Škotija -स्कॉटलैंड

Re: [SOLVED] syntax error, unexpected T_OBJECT_OPERATOR

Post

by abernyte » Thu Dec 23, 2010 6:40 pm

The answer is in the previous posts. Use phpMyAdmin from your Host’s Control Panel and open your database. Open jos_plugins and set the plugin System — Mootools Upgrade to 0 (unpublished)

«Those who expect to reap the blessings of freedom must, like men, undergo the fatigue of supporting it.» Thomas Paine


the-javier

Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Dec 23, 2010 5:18 pm

Re: [SOLVED] syntax error, unexpected T_OBJECT_OPERATOR

Post

by the-javier » Thu Dec 23, 2010 7:46 pm

thank you …
you are very efficient, I’ll do that and be with God ….
have a happy Christmas and new year full of victories and prosperity …..
Until the view.
;D :pop :)


the-javier

Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Dec 23, 2010 5:18 pm

Re: [SOLVED] syntax error, unexpected T_OBJECT_OPERATOR

Post

by the-javier » Wed Dec 29, 2010 5:04 pm

hello ….
well I did in my host’s phpMyAdmin, Control Panel and open the database. Jos_plugins Open and set the plugin System — Upgrade to mootools 0 (not published) and nothing happened ….
I do not know what could have happened …. and already had a lot of information placed on my website, can I recover some information?
Meanwhile I’ll be waiting anxiously for a reply, but thanks for your help in all ways ….


User avatar

cybervigilante

Joomla! Explorer
Joomla! Explorer
Posts: 493
Joined: Mon Apr 23, 2007 11:59 pm
Location: Apache Junction, AZ
Contact:

Re: [SOLVED] syntax error, unexpected T_OBJECT_OPERATOR

Post

by cybervigilante » Wed Jan 26, 2011 10:50 pm

Which field do I set to published=0. there are a bunch of them. I have the latest Joomla 5 and latest joomfish. I set authentication to 0, but is that the one I unset?

There is no mootools upgrade in the table, so that’s not the problem.

Arguing with trolls is like watering bricks and expecting flowers.


avijit4all

Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Feb 03, 2011 2:45 pm

Re: [SOLVED] syntax error, unexpected T_OBJECT_OPERATOR

Post

by avijit4all » Thu Feb 03, 2011 2:51 pm

if you have only ftp or the plugin file is not in the database..
simply delete the folder in
/plugins/system/mtupgrade

or rename it…


rochdalemark

Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon Dec 31, 2007 12:48 pm
Contact:

Re: [SOLVED] syntax error, unexpected T_OBJECT_OPERATOR

Post

by rochdalemark » Sun Feb 06, 2011 11:01 am

Thats fine for removing the error. But is there a fix for this issue. Obviously were trying to install mtupgrade for a reason, or were using a site shaper that requires it etc.
So rather than getting rid of the offending plugin, is there a fix for the plugin so that it runs with php4?


avijit4all

Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Feb 03, 2011 2:45 pm

Re: [SOLVED] syntax error, unexpected T_OBJECT_OPERATOR

Post

by avijit4all » Sun Feb 06, 2011 11:13 am

use php 5 version..
this should solve it..


rochdalemark

Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon Dec 31, 2007 12:48 pm
Contact:

Re: [SOLVED] syntax error, unexpected T_OBJECT_OPERATOR

Post

by rochdalemark » Sun Feb 06, 2011 11:32 am

Not really a solution that I can run with, Hosting is already paid for. I also have a number of domains already hosted with them. So migration is not really feasible for me Im afraid.
I need to know if there is a fix, edit or workaround for my current situation to get mtupgrade to work on a site with php 4.


avijit4all

Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Feb 03, 2011 2:45 pm

Re: [SOLVED] syntax error, unexpected T_OBJECT_OPERATOR

Post

by avijit4all » Sun Feb 06, 2011 11:51 am

use akeeba component to shift hosting..
its very easy to use akeeba..
takes backup..
restore it..
joomla migration in 20 mins


rochdalemark

Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon Dec 31, 2007 12:48 pm
Contact:

Re: [SOLVED] syntax error, unexpected T_OBJECT_OPERATOR

Post

by rochdalemark » Sun Feb 06, 2011 12:08 pm

Like I say, as my hosting is already paid for etc, I dont want to have to migrate. Im looking for a fix for the problem if one exists.


User avatar

abernyte

Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4160
Joined: Fri May 15, 2009 2:01 pm
Location: Écosse — Scozia — Escocia — Škotija -स्कॉटलैंड

Re: [SOLVED] syntax error, unexpected T_OBJECT_OPERATOR

Post

by abernyte » Sun Feb 06, 2011 1:28 pm

Joomla 1.5 is not certified to work with php4. It’s 5.2+ I am afraid.
http://www.joomla.org/about-joomla/tech … ments.html

«Those who expect to reap the blessings of freedom must, like men, undergo the fatigue of supporting it.» Thomas Paine


User avatar

brian

Joomla! Master
Joomla! Master
Posts: 12629
Joined: Fri Aug 12, 2005 7:19 am
Location: Leeds, UK
Contact:

Re: [SOLVED] syntax error, unexpected T_OBJECT_OPERATOR

Post

by brian » Sun Feb 06, 2011 1:46 pm

@rochdalemark php4 is dead. it was officially discontinued by php themselves a long time ago. Any web host that only offers php4 support is clearly a web host that does not care about its customers. Have you spoken to your hosts about this. Many hosts have a simple flip-switch for you to change between php4 and php5


amgadmust

Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Wed Feb 09, 2011 4:48 am

Re: [SOLVED] syntax error, unexpected T_OBJECT_OPERATOR

Post

by amgadmust » Wed Feb 09, 2011 5:47 am

I appreciate your help. THANKS


DavidVavich

Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Thu Jun 12, 2008 2:18 am

Re: [SOLVED] syntax error, unexpected T_OBJECT_OPERATOR

Post

by DavidVavich » Thu May 19, 2011 4:02 pm

I found a fix that worked for me on another site. My host supports BOTH php4 and php5 and even though I have my account set to use php5 by default that does not trickle down to my resold accounts.

Long story short I added the following to my .htaccess file:

Code: Select all

AddHandler application/x-httpd-php5 .php

and it started working instantly.


User avatar

abernyte

Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4160
Joined: Fri May 15, 2009 2:01 pm
Location: Écosse — Scozia — Escocia — Škotija -स्कॉटलैंड

Re: [SOLVED] syntax error, unexpected T_OBJECT_OPERATOR

Post

by abernyte » Thu May 19, 2011 4:58 pm

Thanks for sharing.

«Those who expect to reap the blessings of freedom must, like men, undergo the fatigue of supporting it.» Thomas Paine



Return to “Administration 1.5”


Jump to

  • Joomla! Announcements
  • ↳   Announcements
  • ↳   Announcements Discussions
  • Joomla! 4.x — Ask Support Questions Here
  • ↳   General Questions/New to Joomla! 4.x
  • ↳   Installation Joomla! 4.x
  • ↳   Administration Joomla! 4.x
  • ↳   Migrating and Upgrading to Joomla! 4.x
  • ↳   Extensions for Joomla! 4.x
  • ↳   Security in Joomla! 4.x
  • ↳   Templates for Joomla! 4.x
  • ↳   Search Engine Optimization (Joomla! SEO) in Joomla! 4.x
  • ↳   Language — Joomla! 4.x
  • ↳   Performance — Joomla! 4.x
  • ↳   Joomla! 4.x Coding
  • Joomla! 3.x — Ask Support Questions Here
  • ↳   General Questions/New to Joomla! 3.x
  • ↳   Installation Joomla! 3.x
  • ↳   Joomla! 3.x on IIS webserver
  • ↳   Administration Joomla! 3.x
  • ↳   Access Control List (ACL) in Joomla! 3.x
  • ↳   Migrating and Upgrading to Joomla! 3.x
  • ↳   Security in Joomla! 3.x
  • ↳   Extensions for Joomla! 3.x
  • ↳   Templates for Joomla! 3.x
  • ↳   Search Engine Optimization (Joomla! SEO) in Joomla! 3.x
  • ↳   Language — Joomla! 3.x
  • ↳   Performance — Joomla! 3.x
  • ↳   Joomla! 3.x Coding
  • Joomla! Versions which are End of Life
  • ↳   Joomla! 2.5 — End of Life 31 Dec 2014
  • ↳   General Questions/New to Joomla! 2.5
  • ↳   Installation Joomla! 2.5
  • ↳   Joomla! 2.5 on IIS webserver
  • ↳   Administration Joomla! 2.5
  • ↳   Access Control List (ACL) in Joomla! 2.5
  • ↳   Migrating and Upgrading to Joomla! 2.5
  • ↳   Security in Joomla! 2.5
  • ↳   Extensions for Joomla! 2.5
  • ↳   Templates for Joomla! 2.5
  • ↳   Search Engine Optimization (Joomla! SEO) in Joomla! 2.5
  • ↳   Language — Joomla! 2.5
  • ↳   Performance — Joomla! 2.5
  • ↳   Joomla! 1.5 — End of Life Sep 2012
  • ↳   General Questions/New to Joomla! 1.5
  • ↳   Installation 1.5
  • ↳   Joomla! 1.5 on IIS webserver
  • ↳   Administration 1.5
  • ↳   Migrating and Upgrading to Joomla! 1.5
  • ↳   Security in Joomla! 1.5
  • ↳   Extensions for Joomla! 1.5
  • ↳   Templates for Joomla! 1.5
  • ↳   Search Engine Optimization (Joomla! SEO) in Joomla! 1.5
  • ↳   Language — Joomla! 1.5
  • ↳   Performance — Joomla! 1.5
  • ↳   Joomla! 1.0 — End of Life 22 July 2009
  • ↳   Installation — 1.0.x
  • ↳   Upgrading — 1.0.x
  • ↳   Security — 1.0.x
  • ↳   3rd Party/Non Joomla! Security Issues
  • ↳   Administration — 1.0.x
  • ↳   Extensions — 1.0.x
  • ↳   Components
  • ↳   Modules
  • ↳   Plugins/Mambots
  • ↳   WYSIWYG Editors — 1.0.x
  • ↳   Integration & Bridges — 1.0.x
  • ↳   phpbb — Joomla! Integration
  • ↳   Templates & CSS — 1.0.x
  • ↳   Language — 1.0.x
  • ↳   Joom!Fish and Multilingual Sites
  • ↳   Performance — 1.0.x
  • ↳   General Questions — 1.0.x
  • Joomla! International Language Support
  • ↳   International Zone
  • ↳   Arabic Forum
  • ↳   تنبيهات هامة
  • ↳   الدروس
  • ↳   4.x جوملا!
  • ↳   جوملا! 1.6/1.7
  • ↳   الأسئلة الشائعة
  • ↳   التثبيت و الترقية
  • ↳   الحماية — و تحسين السرعة والأداء
  • ↳   لوحة التحكم
  • ↳   الإضافات البرمجية
  • ↳   تعريب جوملا! و الإضافات البرمجية
  • ↳   القوالب و التصميم
  • ↳   صداقة محركات البحث
  • ↳   القسم العام
  • ↳   1.5 !جوملا
  • ↳   الأسئلة الشائعة
  • ↳   التثبيت و الترقية
  • ↳   الحماية — و تحسين السرعة والأداء
  • ↳   لوحة التحكم
  • ↳   الإضافات البرمجية
  • ↳   تعريب جوملا! و الإضافات البرمجية
  • ↳   القوالب و التصميم
  • ↳   صداقة محركات البحث
  • ↳   القسم العام
  • ↳   جوملا! 1.0
  • ↳   الأسئلة الشائـعة
  • ↳   التثبيت
  • ↳   لوحة التحكم
  • ↳   الإضافات البرمجية
  • ↳   الإضافات المعرّبة
  • ↳   القوالب و التصميم
  • ↳   الحماية — تحسين السرعة والأداء — صداقة محركات البحث
  • ↳   القسم العام
  • ↳   القسم العام
  • ↳   !عرض موقعك بجوملا
  • ↳   الأرشيف
  • ↳   Bengali Forum
  • ↳   Bosnian Forum
  • ↳   Joomla! 1.5
  • ↳   Instalacija i prvi koraci
  • ↳   Ekstenzije
  • ↳   Templejti
  • ↳   Moduli
  • ↳   Prevodi i dokumentacija
  • ↳   Joomla! 1.7 / Joomla! 1.6
  • ↳   Catalan Forum
  • ↳   Notícies
  • ↳   Temes sobre l’administració
  • ↳   Temes sobre la traducció
  • ↳   Components, mòduls i joombots
  • ↳   Temes de disseny
  • ↳   Webs realitzades amb Joomla!
  • ↳   Offtopics
  • ↳   Chinese Forum
  • ↳   Croatian Forum
  • ↳   Danish Forum
  • ↳   Meddelelser
  • ↳   Joomla! 4.x
  • ↳   Joomla! 3.x (Anbefalet til nye installationer. Nyeste funktionalitet)
  • ↳   Installation, backup, opdatering og flytning — Godt igang
  • ↳   Administration — Generel brug
  • ↳   Komponenter, Moduler og Plugins
  • ↳   Template, CSS og Design
  • ↳   Nethandel, betaling m.m.
  • ↳   Ældre versioner (disse vedligeholdes ikke længere fra officiel side)
  • ↳   Joomla! 2.5 (Supporteres indtil 31. dec. 2014)
  • ↳   Installation, backup, opdatering og flytning — Godt igang
  • ↳   Administration — Generel brug
  • ↳   Komponenter, Moduler og Plugins
  • ↳   Template, CSS og Design
  • ↳   Nethandel, betaling m.m.
  • ↳   Joomla 1.5 (Tidligere langtidssupporteret version indtil sep. 2012)
  • ↳   Installation, backup, opdatering og flytning — Godt igang
  • ↳   Administration — Generel brug
  • ↳   Komponenter, Moduler og Plugins
  • ↳   Template, CSS og Design
  • ↳   Nethandel, betaling m.m.
  • ↳   Joomla 1.0 (Udgået version, der blev afløst af 1.5 i 2008)
  • ↳   Installation, backup, opdatering og flytning — Godt igang
  • ↳   Administration — Generel brug
  • ↳   Komponenter, Moduler og Mambots
  • ↳   Template, CSS og Design
  • ↳   Nethandel, betaling m.m.
  • ↳   Oversættelser (lokalisering)
  • ↳   Joomla brugergrupper i Danmark
  • ↳   JUG Kolding
  • ↳   JUG København
  • ↳   JUG Odense
  • ↳   JUG Århus
  • ↳   JUG Sorø
  • ↳   Kommerciel (betalt) hjælp ønskes
  • ↳   SEO
  • ↳   FAQ — Dokumentation og vejledninger
  • ↳   Vis dit websted
  • ↳   Afviste ‘Vis dit websted’ indlæg
  • ↳   Diverse (Off topic)
  • ↳   Dutch Forum
  • ↳   Aankondigingen
  • ↳   Algemene vragen
  • ↳   Joomla! 4.x
  • ↳   Joomla! 3.x
  • ↳   Installatie 3.x
  • ↳   Extensies 3.x
  • ↳   Templates 3.x
  • ↳   Joomla! 2.5
  • ↳   Installatie 2.5
  • ↳   Componenten 2.5
  • ↳   Modules 2.5
  • ↳   Plugins 2.5
  • ↳   Templates 2.5
  • ↳   Joomla! 1.5
  • ↳   Installatie
  • ↳   Componenten
  • ↳   Modules
  • ↳   Plugins
  • ↳   Templates
  • ↳   Joomla! 1.0
  • ↳   Installatie 1.0.x
  • ↳   Componenten 1.0.x
  • ↳   Modules 1.0.x
  • ↳   Mambots 1.0.x
  • ↳   Templates 1.0.x
  • ↳   Vertalingen
  • ↳   Offtopic
  • ↳   Show jouw website
  • ↳   Filipino Forum
  • ↳   International Support Center
  • ↳   Pinoy General Discussion & Archives
  • ↳   Site Showcase
  • ↳   Events
  • ↳   Design Tips and Tricks
  • ↳   Tsismis Zone
  • ↳   Pinoy Translation Zone
  • ↳   Pinoy Forum Archives
  • ↳   Joomla! Philippines Local Forum www.joomla.org.ph
  • ↳   Finnish Forum
  • ↳   French Forum
  • ↳   Les annonces!
  • ↳   Le bistrot!
  • ↳   L’expo!
  • ↳   J! 4.x — L’atelier!
  • ↳   J! 3.x — L’atelier!
  • ↳   3.x — Questions générales, nouvel utilisateur
  • ↳   3.x — Installation, migration et mise à jour
  • ↳   3.x — Sécurité et performances
  • ↳   3.x — Extensions tierce partie
  • ↳   3.x — Templates et design
  • ↳   3.x — Développement
  • ↳   3.x — Ressources
  • ↳   J! 2.5.x — L’atelier!
  • ↳   2.5 — Questions générales
  • ↳   2.5 — Installation, migration et mise à jour
  • ↳   2.5 — Sécurité et performances
  • ↳   2.5 — Extensions tierce partie
  • ↳   2.5 — Templates et design
  • ↳   2.5 — Développement
  • ↳   2.5 — Ressources
  • ↳   J! 1.5.x — L’atelier!
  • ↳   1.5 — Questions générales
  • ↳   1.5 — Installation, migration et mise à jour
  • ↳   1.5 — Sécurité et performances
  • ↳   1.5 — Extensions tierce partie
  • ↳   1.5 — Templates et design
  • ↳   1.5 — Développement
  • ↳   1.5 — Ressources
  • ↳   J! 1.0.x — L’atelier!
  • ↳   1.0 — Questions générales
  • ↳   1.0 — Installation et mise à jour
  • ↳   1.0 — Sécurité
  • ↳   1.0 — Extensions tierce partie
  • ↳   1.0 — Templates et design
  • ↳   1.0 — Développement
  • ↳   1.0 — Ressources
  • ↳   Besoin d’un professionel ?
  • ↳   Extensions Open Source pour Joomla!
  • ↳   German Forum
  • ↳   Ankündigungen
  • ↳   Joomla! 4.x
  • ↳   Joomla! 3.x
  • ↳   Allgemeine Fragen
  • ↳   Installation und erste Schritte
  • ↳   Komponenten, Module, Plugins
  • ↳   Template, CSS und Designfragen
  • ↳   Entwicklerforum
  • ↳   Zeige Deine Webseite
  • ↳   Joomla! 2.5
  • ↳   Allgemeine Fragen
  • ↳   Installation und erste Schritte
  • ↳   Komponenten, Module, Plugins
  • ↳   Template, CSS und Designfragen
  • ↳   Entwicklerforum
  • ↳   Zeige Deine Webseite
  • ↳   Joomla! 1.5
  • ↳   Allgemeine Fragen
  • ↳   Installation und erste Schritte
  • ↳   Komponenten, Module, Plugins
  • ↳   Template, CSS und Designfragen
  • ↳   Entwicklerforum
  • ↳   Zeige Deine Webseite
  • ↳   Professioneller Service
  • ↳   Sonstiges (Offtopic)
  • ↳   Archiv
  • ↳   Joomla! 1.0
  • ↳   Allgemeine Fragen 1.0.x
  • ↳   Installation und erste Schritte 1.0.x
  • ↳   Komponenten, Module, Mambots 1.0.x
  • ↳   Template, CSS und Designfragen 1.0.x
  • ↳   Entwicklerforum 1.0.x
  • ↳   Zeige Deine Webseite 1.0.x
  • ↳   Greek Forum
  • ↳   Joomla! 4.x
  • ↳   Joomla! 3.x
  • ↳   Joomla! 2.5.x
  • ↳   Joomla! 1.5.x
  • ↳   Joomla! 1.0.x
  • ↳   Hebrew Forum
  • ↳   Indic Languages Forum
  • ↳   Indonesian Forum
  • ↳   FAQ
  • ↳   Bantuan
  • ↳   Komponen
  • ↳   Modul
  • ↳   Template
  • ↳   Diskusi
  • ↳   Italian Forum
  • ↳   Guide
  • ↳   Traduzioni
  • ↳   Componenti — Moduli — Plugins
  • ↳   Template — Grafica
  • ↳   Notizie
  • ↳   Prodotti Open Source per Joomla!
  • ↳   Richieste professionali
  • ↳   Joomla! 4.x
  • ↳   Joomla! 3.x
  • ↳   Joomla! 2.5.x
  • ↳   Joomla! 1.x
  • ↳   Latvian Forum
  • ↳   Lithuanian Forum
  • ↳   Joomla! 4.x
  • ↳   Joomla! 1.5
  • ↳   Joomla! 1.7 / Joomla! 1.6
  • ↳   Joomla! 1.0
  • ↳   Vertimai ir Kalba
  • ↳   Malaysian Forum
  • ↳   Solved
  • ↳   Norwegian Forum
  • ↳   Informasjon
  • ↳   Arkiverte annonseringer
  • ↳   FAQ — Ofte spurte spørsmål
  • ↳   Arkiv
  • ↳   Joomla! 4.x
  • ↳   Joomla! 3.x
  • ↳   Administrasjon/installasjon
  • ↳   Migrering/Oppdatering
  • ↳   Template, CSS og design
  • ↳   Komponenter/moduler/programutvidelser
  • ↳   Sikkerhet
  • ↳   Generelt
  • ↳   Netthandel, betaling m.m.
  • ↳   VirtueMart
  • ↳   Andre nettbutikkløsninger
  • ↳   Generelt
  • ↳   Oversettelser
  • ↳   Fremvisning av sider (Show off)
  • ↳   Avviste fremvisninger
  • ↳   Diverse (off topic)
  • ↳   Kommersiell hjelp ønskes
  • ↳   Eldre versjoner av Joomla!
  • ↳   Joomla! 1.0
  • ↳   Administrasjon/installasjon
  • ↳   Template, CSS og design
  • ↳   Komponenter/moduler/mambots
  • ↳   Sikkerhet
  • ↳   Generelt
  • ↳   Joomla! 1.5
  • ↳   Administrasjon/installasjon
  • ↳   Migrering/Oppdatering
  • ↳   Template, CSS og design
  • ↳   Komponenter/moduler/programutvidelser
  • ↳   Sikkerhet
  • ↳   Generelt
  • ↳   Joomla! 2.5
  • ↳   Administrasjon/installasjon
  • ↳   Migrering/Oppdatering
  • ↳   Template, CSS og design
  • ↳   Komponenter/moduler/programutvidelser
  • ↳   Sikkerhet
  • ↳   Generelt
  • ↳   Persian Forum
  • ↳   قالب ها
  • ↳   مدیریت
  • ↳   سوالهای عمومی
  • ↳   نصب
  • ↳   مامبوت ها
  • ↳   ماژولها
  • ↳   کامپوننت ها
  • ↳   Polish Forum
  • ↳   Instalacja i aktualizacja
  • ↳   Administracja
  • ↳   Komponenty, moduły, wtyczki
  • ↳   Szablony
  • ↳   Paczta i Podziwiajta
  • ↳   Modyfikacje i własne rozwiązania
  • ↳   Tłumaczenia
  • ↳   FAQ
  • ↳   Tips&Tricks
  • ↳   Dokumentacja
  • ↳   Profesjonalne usługi
  • ↳   Portuguese Forum
  • ↳   Componentes, módulos e mambots
  • ↳   Programação e desenvolvimento
  • ↳   Segurança
  • ↳   Sites dos usuários
  • ↳   Off-topic
  • ↳   Tradução
  • ↳   Templates
  • ↳   Romanian Forum
  • ↳   Traduceri
  • ↳   Russian Forum
  • ↳   Объявления по Joomla!
  • ↳   Безопасность Joomla!
  • ↳   Joomla 4.x — Задайте здесь свой вопрос по поддержке
  • ↳   Joomla 3.x — Задайте здесь свой вопрос по поддержке
  • ↳   Общие вопросы/Новичок в Joomla! 3.x
  • ↳   Установка Joomla! 3.x
  • ↳   Миграция и переход на Joomla! 3.x
  • ↳   Расширения для Joomla! 3.x
  • ↳   Многоязычные веб-сайты на Joomla 3.x
  • ↳   Joomla 2.5 — Задайте здесь свой вопрос по поддержке
  • ↳   Общие вопросы/Новичок в Joomla! 2.5
  • ↳   Установка Joomla! 2.5
  • ↳   Расширения для Joomla! 2.5
  • ↳   Русский язык Joomla! 2.5
  • ↳   Serbian/Montenegrin Forum
  • ↳   Tehnička pitanja
  • ↳   Instalacija i početnička pitanja
  • ↳   Šabloni
  • ↳   Prevod i dokumentacija
  • ↳   Ćaskanje
  • ↳   Bezbednost
  • ↳   Joomla! dodaci
  • ↳   Pravna pitanja
  • ↳   Arhiva
  • ↳   Joomla! Događaji i Zajednica
  • ↳   Izlog (spisak) sajtova radjenih u Joomla! CMS-u
  • ↳   Profesionalne usluge
  • ↳   Slovak Forum
  • ↳   Spanish Forum
  • ↳   Joomla! 4.x
  • ↳   Joomla! 3.x
  • ↳   Migración y actualización a Joomla 3.x
  • ↳   Versiones de Joomla! obsoletas
  • ↳   Joomla! 2.5
  • ↳   Joomla! 1.5
  • ↳   Extensiones
  • ↳   Plantillas (templates) y diseño
  • ↳   Idioma y traducciones
  • ↳   SEO para Joomla!
  • ↳   Seguridad y rendimiento
  • ↳   Productos de Código Abierto para Joomla!
  • ↳   Servicios profesionales
  • ↳   Salón de la comunidad Ñ
  • ↳   Swedish Forum
  • ↳   Meddelanden
  • ↳   Forum Joomla! 4.x
  • ↳   Forum Joomla! 3.x
  • ↳   Allmänna frågor
  • ↳   Användning och administration
  • ↳   Installation, backup och säkerhet
  • ↳   Komponenter, moduler och plugin
  • ↳   Mallar (templates) och design
  • ↳   Äldre versioner
  • ↳   Forum Joomla! 1.0
  • ↳   Allmänna frågor
  • ↳   Användning och administration
  • ↳   Installation, backup och säkerhet
  • ↳   Komponenter, moduler och Mambots
  • ↳   Mallar (templates) och design
  • ↳   Forum Joomla! 1.7 / Joomla! 1.6
  • ↳   Allmänna frågor
  • ↳   Användning och administration
  • ↳   Installation, backup och säkerhet
  • ↳   Komponenter, moduler och plugin
  • ↳   Mallar (templates) och design
  • ↳   Forum Joomla! 1.5
  • ↳   Allmänna frågor
  • ↳   Användning och administration
  • ↳   Installation, backup och säkerhet
  • ↳   Komponenter, moduler och plugin
  • ↳   Mallar (templates) och design
  • ↳   Forum Joomla! 2.5
  • ↳   Allmänna frågor
  • ↳   Användning och administration
  • ↳   Installation, backup och säkerhet
  • ↳   Komponenter, moduler och plugin
  • ↳   Mallar (templates) och design
  • ↳   Översättning
  • ↳   Webbplatser gjorda i Joomla
  • ↳   Webbplatser J! 3.x
  • ↳   Webbplatser J! 2.5
  • ↳   Webbplatser Joomla! 1.7 / Joomla! 1.6
  • ↳   Webbplatser J! 1.5
  • ↳   Webbplatser J! 1.0
  • ↳   Kommersiell hjälp önskas
  • ↳   Diverse (off topic)
  • ↳   Tamil Forum
  • ↳   Thai Forum
  • ↳   โชว์เว็บไซต์ของคุณที่สร้างด้วยจูมล่า
  • ↳   เคล็ดลับการใช้งานส่วนต่างๆ เกี่ยวกับจ&#
  • ↳   คอมโพเน้นท์ โมดูล ปลักอิน ต่างๆ ที่ติดตั
  • ↳   อับเดดข่าวสารเกี่ยวกับจูมล่าลายไทย
  • ↳   Turkish Forum
  • ↳   Duyurular
  • ↳   Dersler
  • ↳   Genel Sorular
  • ↳   Bileşen, Modül, Bot
  • ↳   Eklenti Haberleri
  • ↳   Temalar
  • ↳   Vietnamese Forum
  • ↳   Gặp gỡ và giao lưu
  • ↳   Joomla Tiếng Việt
  • ↳   Cài đặt — Cấu hình
  • ↳   Thành phần mở rộng cho Joomla!
  • ↳   Hỏi đáp Joomla! 3.x
  • ↳   Hỏi đáp Joomla! 2.5
  • ↳   Hỗ trợ kỹ thuật
  • ↳   Bài viết cũ
  • ↳   Thiết kế Template
  • ↳   Joomla! 1.5
  • ↳   Hỏi đáp Joomla! 4.x
  • ↳   Welsh Forum
  • Other Forums
  • ↳   Open Source Products for Joomla!
  • ↳   The Lounge
  • ↳   Forum Post Assistant (FPA)
  • Joomla! Development Forums
  • Joomla! Official Sites & Infrastructure
  • ↳   docs.joomla.org — Feedback/Information
  • ↳   extensions.joomla.org — Feedback/Information
  • ↳   joomla.com — Feedback/Information
  • ↳   Sites & Infrastructure — Feedback/Information
  • ↳   Archived Boards — All boards closed
  • ↳   Design and Accessibility — Archived
  • ↳   Quality and Testing — Locked and Archived
  • ↳   Joomla! 1.0.x_Q&T
  • ↳   Q&T 1.0.x Resolved
  • ↳   Known Issues
  • ↳   Superseded Issues
  • ↳   Archive
  • ↳   Q&T 1.0.x Resolved — Archived
  • ↳   Known Issues — Archive
  • ↳   Superseded Issues — Archive
  • ↳   Joomla! 3.x Bug Reporting
  • ↳   Third Party Testing for Joomla! 1.5
  • ↳   Q&T 1.5.x Resolved
  • ↳   Joomla! 1.5 BETA
  • ↳   Joomla! 1.5 BETA 2
  • ↳   Reaction to the ‘Letter to the community’
  • ↳   Reaction to New Project Name
  • ↳   Logo Competition
  • ↳   Humor, Fun and Games
  • ↳   Libraries
  • ↳   patTemplate
  • ↳   com_connector — Multi Joomla Bridge
  • ↳   CiviCRM Support
  • ↳   CiviCRM Installation Issues
  • ↳   FAQ Archive
  • ↳   FAQ Discussion Board
  • ↳   3rd Party Extensions FAQ
  • ↳   FAQs not moved
  • ↳   3rd Party/Non Joomla! Security FAQ
  • ↳   Joomla! Coding 101
  • ↳   Joombie Tools of the Trade
  • ↳   Joombie Coding Q/A
  • ↳   Joombie Think Tank
  • ↳   Joombie Developer Lab
  • ↳   Joomla Forge — Archived
  • ↳   Non-Profit Organizations and Joomla!
  • ↳   Schools and Universities
  • ↳   Bangsamoro Forum
  • ↳   Joomla! 1.5 Template Contest
  • ↳   SMF — Simplemachines.org Forum
  • ↳   GPL Discussion
  • ↳   Security Announcements — Old
  • ↳   Tips & Tricks — Moving
  • ↳   Submit Your Suggested Tips & Tricks to Docs.joomla.org now please.
  • ↳   Google Summer of Code and GHOP
  • ↳   Google Summer of Code 2008
  • ↳   Proposed projects
  • ↳   Student area
  • ↳   Past Google Summer of Code Editions
  • ↳   Google’s Highly Open Participation Contest
  • ↳   Documentation
  • ↳   Suggestions, Modifications, and Corrections
  • ↳   Archive
  • ↳   1.5 Archive
  • ↳   Suggestions, Modifications & Corrections
  • ↳   Submit
  • ↳   Feedback and Suggestions
  • ↳   Applications for participation in the Development Workgroup
  • ↳   Development
  • ↳   1.5 Site Showcase — Archived
  • ↳   1.0 x Site Showcase — Archived.
  • ↳   Feature Requests — White Papers — Archived
  • ↳   Under Review — Archived
  • ↳   Accepted — Archived
  • ↳   Not Accepted — Archived
  • ↳   Wishlists and Feature Requests — Archive
  • ↳   Wishlist Archives — Archived
  • ↳   Spanish Forum — Archive
  • ↳   Papelera
  • ↳   Tutoriales
  • ↳   General
  • ↳   Salón de la Joomlaesfera hispanohablante
  • ↳   Danish Forum — Archive
  • ↳   Diskussion af Meddelelser + Sikkerhedsmeddelelser + FAQ
  • ↳   Shop.Joomla.org
  • ↳   Joomla! 1.6 RC Support [closed]
  • ↳   Joomla! 1.0 Coding
  • ↳   Core Hacks and Patches
  • ↳   Joomla! 2.5 Beta Support
  • ↳   People.joomla.org — Feedback/Information
  • ↳   Joomla! 1.5 Bug Reporting
  • ↳   Joomla! 1.5 Coding
  • ↳   Joomla! 3 Beta Support
  • ↳   Trending Topics
  • ↳   Help wanted in the community
  • ↳   templates.joomla.org — Feedback/Information
  • ↳   Certification
  • ↳   Albanian Forum
  • ↳   Azeri Forum
  • ↳   Urdu Forum
  • ↳   Basque Forum
  • ↳   Itzulpenaren inguruan
  • ↳   Laguntza teknikoa
  • ↳   Belarusian Forum
  • ↳   Maltese Forum
  • ↳   Hungarian Forum
  • ↳   Slovenian Forum
  • ↳   Japanese Forum
  • ↳   Khmer Forum
  • ↳   ពិពណ៌​ស្ថាន​បណ្ដាញ​ជុំឡា
  • ↳   ជុំឡា​ខ្មែរ​មូលដ្ឋានីយកម្ម
  • ↳   Community Blog Discussions
  • ↳   JoomlaCode.org
  • ↳   Joomla! Marketing and PR Team
  • ↳   resources.joomla.org — Feedback/Information
  • ↳   Training.Joomla.org
  • ↳   OpenSourceMatters.org
  • ↳   magazine.joomla.org — Feedback/Information
  • ↳   Site Showcase
  • ↳   Joomla! 4 Related
  • ↳   Joomla! Events
  • ↳   Joomla! Ideas Forum
  • ↳   Registered Joomla! User Groups
  • ↳   Joomla! 2.5 Coding
  • ↳   Joomla! 2.5 Bug Reporting
  • ↳   User eXperience (UX)
  • ↳   Joomla! Working Groups
  • ↳   Translations

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.

Already on GitHub?
Sign in
to your account

Comments

@jmichaelterenin

Getting this error when attempting to perform:
php artisan firewall:tables (no problems)
php artisan migrate (error occurs)

I assumed you were referencing the geoip2/geoip2 package, even though you state that it’s optional in the documentation, so I required it in my composer, performed a composer update, dump-autoload, and returning to the migration step, I still get the error.

Can you assist? Thanks

@antonioribeiro

Which version are you using?

@jmichaelterenin

Hi Antonio,
Sorry for not including:
Laravel 5.4,
«pragmarx/firewall» : «^2.0»,
«geoip2/geoip2» : «~2.0»,

@antonioribeiro

Line 584 related to the updategeoip command

image

And it is not executed elsewhere.

@jmichaelterenin

Sure, I saw that, but I’m sorry, I’m unfamiliar with the Geoip package, not sure what that means, I don’t even plan on using any country blacklisting, just ip address …

@antonioribeiro

So, the problem was during «artisan migrate» or «artisan firewall:updategeoip»?

Could you, please send us the whole error message, and the call stack? Should appear in your laravel.log

@jmichaelterenin

[2017-08-25 12:13:56] local.ERROR: exception 'SymfonyComponentDebugExceptionFatalErrorException' with message 'syntax error, unexpected '->' (T_OBJECT_OPERATOR)' in C:xampphtdocsexplorevendorpragmarxfirewallsrcFirewall.php:584 Stack trace: #0 {main}

That is the entire call stack.
occurs with «artisan migrate»

@antonioribeiro

You get nothing in storage/logs/laravel.log?

@jmichaelterenin

Hi Antonio,
What is highlighted in code (with the time stamp), is what I get in laravel.log

@antonioribeiro

So files must have not downloaded as they should. Try to remove vendor/pragmarx and then

again

@jmichaelterenin

ok, I’ll let you know if it gets resolved with a fresh download, thanks

@justplayingames

I see the same error

php version 5.6.24
pragmarx/firewall version»: «v1.1.0»,

It acts a syntax error. I get the error when attempting to serve my index page using php artisan serve. This route is using the firewall package.

A quick fix was to change line 521 to do it in two lines:

$updater = new GeoIpUpdater;
$success = $updater->updateGeoIpFiles($this->config->get('geoip_database_path'));

I confirmed the same fix on line 584 of pragmarx/firewall version 2.0.1

@antonioribeiro

Just tagged version 2.0.2.

Thank you all.

@jmichaelterenin

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;
}

Sathiya Kumar V M's user avatar

asked Dec 10, 2015 at 10:59

preissy's user avatar

3

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.

answered Dec 31, 2015 at 21:31

MrWhite's user avatar

MrWhiteMrWhite

42k4 gold badges48 silver badges89 bronze badges

We are moving our forum in GitHub Discussions.
For questions about Phalcon v3/v4 you can visit
here
and for Phalcon v5
here.

  1. Home
  2. Volt
Created
Feb ’15
Last Reply
Feb ’15
Replies
2
Views
2902
Votes
0

Controller

<?php
public function indexAction()
    {
        $item = new stdClass();
        $item->var1 = '1';
        $item->var2 = '2';
        $item->var4 = '3';
        $test = array(
            'item' =>  $item
        );
        $this->view->setVars(array(
            'test' => $test
        ));
    }

Volt template

{{ dump(test['item'].var1) }}

Code generated in cache

<?php echo var_dump(($test['item'])->var1); ?>

Volt template

{{ test['item'].var1 }}

Code generated in cache

<?php echo ($test['item'])->var1; ?>

I get
( ! ) Parse error: syntax error, unexpected ‘->’ (T_OBJECT_OPERATOR), expecting ‘,’ or ‘;’ in /work/nested-set/tree/app/cache/_work_nested-set_tree_app_views_index_index.volt.php on line 26

In Controller all works as usual


var_dump($test['item']->var1); //1

My question is there is a bug or my mistake?

This structure works as expected

{% for t in tree %}
    {% set a = t["item"] %}
    {{ a.getName() }}
{% endfor %}

But why do I have create another variable for getting object property?

Thanks

Hi,

As far as I know, it is not possible to wrap an object and try to access its property like this :

($test['item'])->var1;

That is why the generated code get a parse error.
I don’t know why the code generate like this.

With the structure you show :

{% for t in tree %}
    {% set a = t["item"] %}
    {{ a.getName() }}
{% endfor %}

You will get something like :

$a = $t['item'];
echo $a->getName();

And not ($t["item"])->getName();, so it will work.


edited Feb ’15

Feb ’15

Yeap.

You are right. Probably my question was not clear. Because English is not my native language.

This code placed in volt’s cache file. in case when I print in Volt’s template {{ test[‘item’].var1 }}

echo ($test['item'])->var1;

I did not print it by my fingers )))

b4v is right. You need to set a var that is one of your array’s items, no other way to do it in Volt. That happened to me time ago.

Thanks you all.
Seems like it’s a bug.
Very sad that we have to generate extra variables for that.

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Parse error syntax error unexpected in opencart
  • Parse error syntax error unexpected in denwer
  • Parse error syntax error unexpected expecting variable
  • Parse error syntax error unexpected expecting end of file in
  • Parse error syntax error unexpected end of file in что значит

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии