Link to home
Start Free TrialLog in
Avatar of mimoser
mimoserFlag for United States of America

asked on

Unexpected T_DOUBLE_ARROW

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

ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ludofulop
ludofulop

i think that error is in other file...
Avatar of mimoser

ASKER

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

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.
Avatar of mimoser

ASKER

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

@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!
please include all the contents of the file /public_html/include/settings/common.sett.php
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

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
same feeling here. ...