Parse Error Syntax Error Unexpected T_object_operator In On Line 35
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company syntax error unexpected t_object_operator in codeigniter Business Learn more about hiring developers or posting ads with us Stack Overflow Questions parse error syntax error unexpected t_object_operator in cakephp Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, parse error: syntax error, unexpected t_object_operator wordpress just like you, helping each other. Join them; it only takes a minute: Sign up PHP Parse error: syntax error, unexpected T_OBJECT_OPERATOR up vote 33 down vote favorite 7 I get this error when debugging: PHP
Parse Error: Syntax Error, Unexpected T_object_operator Yii
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in order.php on line 72 Here is a snippet of the code: line 72: $purchaseOrder = new PurchaseOrderFactory->instance(); $arrOrderDetails = $purchaseOrder->load($customerName); php share|improve this question edited Nov 14 '12 at 22:41 amon 44.8k256107 asked Nov 14 '12 at 22:33 user1825110 163125 2 Why was this question closed? The question and the first response below was helpful. –Paul Rigor Sep 17 '13 at 0:51 add a comment| 3 unexpected t object operator codeigniter Answers 3 active oldest votes up vote 50 down vote accepted 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(); In previous versions, you have to call the method on a variable: $purchaseFactory = new PurchaseOrderFactory; $purchaseOrder = $purchaseFactory->instance(); Note: The later is probably even more useful/wise even after you've upgraded to PHP 5.4 because those two lines can be better separated and there is less code containing a hard-encoded classname, here the name of the factory class PurchaseOrderFactory. This will make you more fluent maintaining the code over time. share|improve this answer edited Aug 12 '14 at 16:18 answered Nov 14 '12 at 22:36 SirDarius 21.8k44661 Even if he used his code on PHP 5.4 that would generate a syntax error. –Muntashir Akon Oct 15 '15 at 13:48 add a comment| up vote 2 down vote 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 share|improve this answer answered Nov 14 '12 at 22:34 Samuel Cook 11.2k22034 add a comment| up vote 1 down vote You can't use (it's invalid php syn
were looking for could not https://wordpress.org/support/topic/436800 be found. I'm sorry, it's not your fault… probably. About Blog Hosting Jobs Support Developers Get Involved Learn Showcase Plugins Themes Ideas WordCamp WordPress.TV BuddyPress bbPress WordPress.com Matt Privacy License / GPLv2 Code is Poetry.
that make connections all over the world. Join today Download & Extend Drupal Core Distributions Modules https://www.drupal.org/node/264270 Themes Terms of UseIssues unexpected T_OBJECT_OPERATOR Closed (fixed)Project:Terms of UseVersion:6.x-1.2Component:CodePriority:NormalCategory:Bug reportAssigned:Chill35Reporter:mortensonCreated:May 29, 2008 - 17:41Updated:June 17, 2008 - 19:42 Log in or register to update this issue Downloaded the module, and extract it in my modules folder. Before even activate it I get: Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting syntax error ')' in /home/nosfuimo/public_html/sites/all/modules/terms_of_use/terms_of_use.module on line 61 Comments Comment #1 Chill35 CreditAttribution: Chill35 commented May 29, 2008 at 8:17pm I am unable to reproduce but I believe you... However, before a module is activated, "in theory"... its *.module file is not parsed... only the *.info file is read on the Modules page... syntax error, unexpected so it's hard to understand... I downloaded the 6.x-1.2 version and had no problems with it, eitheir with it enabled or not. I will create a new release tonight, 6.x-1.3. Log in or register to post comments Comment #2 rodrigo21 CreditAttribution: rodrigo21 commented June 3, 2008 at 3:18pm Hello, I have tried with version 6.x-1.4 now, but I get: Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/nosfuimo/public_html/sites/all/modules/terms_of_use/terms_of_use.module on line 137 thanks for updating the module anyway. I have also cleared my cache (just in case). Log in or register to post comments Comment #3 Chill35 CreditAttribution: Chill35 commented June 3, 2008 at 6:13pm Title: unexpected T_OBJECT_OPERATOR ยป Error befor activating What version of Drupal are you using? 6.2? What version of PHP are you using? 5.1 or up? Are you absolutely sure that the module is NOT enabled? It probably is. That's why the module file is parsed... The line t