?
Solved

Unexpected T_DOUBLE_ARROW

Posted on 2010-01-11
10
Medium Priority
?
511 Views
Last Modified: 2013-12-12
I have some third party software that was working great until I added a mod to it. Now I get an error or unexpected T_DOUBLE_ARROW on line 193 on a diffrent page.  I don't get it the code below has worked great for months until now, now it pops an error. Can someone please take a look and see what's cause this on line 193?


186	array
187	(
188		'id' => 3,
189		'name' => 'Myspace',
190		'url' => 'myspace\.com',
191		'image' => false,
192		'import' => false,
193	),
194	array
195	(
196		'id' => 6,
197		'name' => 'Break',
198		'url' => 'break\.com',
199		'image' => true,
200		'import' => false,
201	),

Open in new window

0
Comment
Question by:mimoser
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
10 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 26281519
190            'url' => 'myspace\.com',

should be:

190            'url' => 'myspace.com',
or:
190            'url' => 'myspace\\.com',
0
 
LVL 15

Expert Comment

by:ludofulop
ID: 26281560
i think that error is in other file...
0
 

Author Comment

by:mimoser
ID: 26281607
Here is a portion of the file I added. During troubleshooting I have managed to comment out this section, and my site works again. If I uncomment this section it gives me the error to the page I posted above.
$shared_dir  = realpath(dirname(dirname(__FILE__)))."/phpsnsshared/"; // Pet Mod only
$classes_dir = realpath(dirname(dirname(__FILE__)))."/phpsnsshared/classes/";
require_once($shared_dir."functions.php"); // Pet Mod only
require_once($shared_dir."ObjectSQL.class.php"); // Pet Mod only
require_once($classes_dir."snsVarsPlugin.php");
require_once($classes_dir."snsObject.php"); // Pet Mod only
require_once($classes_dir."snsUserLang.php"); // Pet Mod only
require_once($classes_dir."snsSendMail.php"); // Pet Mod only
require_once($classes_dir."snsSendMess.php"); // Pet Mod only
require_once("include/snsPetObject.php"); // this mod only
require_once("include/snsPetFunc.php"); // Pet Mod only
require_once("include/snsMembership.php"); // Pet Mod only
require_once("include/snsPetLinks.php"); // Pet Mod only
require_once("include/snsPetTransaction.php"); // Pet Mod only
require_once("include/snsPetBox.php"); // Pet Mod only
$oVars   = new snsPetVars();
$snsLang = new snsPetLang();

Open in new window

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 15

Expert Comment

by:ludofulop
ID: 26281655
please paste your full error here. There should be written the file name, in which you have error... check out line #193 in that file name. I believe that it's not the portion of the code you wrote in the question.
0
 

Author Comment

by:mimoser
ID: 26281686
Line #193 was the
), from my first post. That file has always worked fine and wasnt changed tonight. This new file is somehow making that file error out.

PHP Parse error:  syntax error, unexpected T_DOUBLE_ARROW in /public_html/include/settings/common.sett.php on line 193

I have done more trouble shooting commenting and uploading. My site works great with the three lines below commented out. If I allow them, it turns the homepage white, and give me the error about line 193.

$shared_dir  = realpath(dirname(dirname(__FILE__)))."/phpsnsshared/"; 
$classes_dir = realpath(dirname(dirname(__FILE__)))."/phpsnsshared/classes/";
//require_once($shared_dir."functions.php"); 
//require_once($shared_dir."ObjectSQL.class.php"); 
require_once($classes_dir."snsVarsPlugin.php");
require_once($classes_dir."snsObject.php"); 
require_once($classes_dir."snsUserLang.php"); 
require_once($classes_dir."snsSendMail.php"); 
require_once($classes_dir."snsSendMess.php"); 
require_once("include/snsPetObject.php"); 
require_once("include/snsPetFunc.php"); 
require_once("include/snsMembership.php"); 
require_once("include/snsPetLinks.php"); 
require_once("include/snsPetTransaction.php"); 
require_once("include/snsPetBox.php"); 
//$oVars   = new snsPetVars();
$snsLang = new snsPetLang();

Open in new window

0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 26282879
@mimoser: The error on line 193 would be easier for us to isolate if you posted all the code so we could see the REAL LINE 193!
0
 
LVL 15

Expert Comment

by:ludofulop
ID: 26282900
please include all the contents of the file /public_html/include/settings/common.sett.php
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 26282949
But since we have to guess until you post all the code, here is my guess...

You have an unterminated statement - missing a semicolon at the end.  Or you have some kind of construct, maybe in an IF statement, that unexpectedly brings PHP upon a double-arrow.  It is probably in one of the include scripts.

FWIW, I tried this, based on your original post, and it parses correctly.
<?php // RAY_temp_mimoser.php
error_reporting(E_ALL);
echo "<pre>\n";

$thing = array (
array
(
         'id' => 3,
         'name' => 'Myspace',
         'url' => 'myspace\.com',
         'image' => false,
         'import' => false,
 ),
array
(
         'id' => 6,
         'name' => 'Break',
         'url' => 'break\.com',
         'image' => true,
         'import' => false,
 ),
);

var_dump($thing);

Open in new window

0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 26500905
I am kind of mystified here.  What was the fix?  I took EXACTLY what you posted and it worked.  How did changing the number of backslashes have an effect?  Please fill us in on the details, thanks. ~Ray
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 26501765
same feeling here. ...
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question