Parse error: syntax error, unexpected T_OBJECT_OPERATOR with script from sharrre.php
<p>I need to run this script on my site and I have no experience at all with PHP</p>

<p>When I call the following script</p>

<pre><code>&lt;?php
  //Sharrre by Julien Hany
  $json = array('url'=&gt;'','count'=&gt;0);
  $json['url'] = $_GET['url'];
  $url = urlencode($_GET['url']);
  $type = urlencode($_GET['type']);

  if(filter_var($_GET['url'], FILTER_VALIDATE_URL)){
    if($type == 'googlePlus'){  //source http://www.helmutgranda.com/2011/11/01/get-a-url-google-count-via-php/
      $content = parse("https://plusone.google.com/u/0/_/+1/fastbutton?url=".$url."&amp;count=true");

      $dom = new DOMDocument;
      $dom-&gt;preserveWhiteSpace = false;
      @$dom-&gt;loadHTML($content);
      $domxpath = new DOMXPath($dom);
      $newDom = new DOMDocument;
      $newDom-&gt;formatOutput = true;

      $filtered = $domxpath-&gt;query("//div[@id='aggregateCount']");
      $json['count'] = str_replace('&gt;', '', $filtered-&gt;item(0)-&gt;nodeValue);
    }
    else if($type == 'stumbleupon'){
      $content = parse("http://www.stumbleupon.com/services/1.01/badge.getinfo?url=$url");

      $result = json_decode($content);
      $json['count'] = $result-&gt;result-&gt;views;
      if( !isset($json['count']) ) $json['count'] = 0;
    }
    else if($type == 'pinterest'){
      $content = parse("http://api.pinterest.com/v1/urls/count.json?callback=&amp;url=$url");

      $result = json_decode(str_replace(array('(', ')'), array('', ''), $content));
      $json['count'] = $result-&gt;count;
      if( !isset($json['count']) ) $json['count'] = 0;
    }
  }
  echo str_replace('\\/','/',json_encode($json));

  function parse($encUrl){
    $options = array(
      CURLOPT_RETURNTRANSFER =&gt; true, // return web page
      CURLOPT_HEADER =&gt; false, // don't return headers
      CURLOPT_FOLLOWLOCATION =&gt; true, // follow redirects
      CURLOPT_ENCODING =&gt; "", // handle all encodings
      CURLOPT_USERAGENT =&gt; 'sharrre', // who am i
      CURLOPT_AUTOREFERER =&gt; true, // set referer on redirect
      CURLOPT_CONNECTTIMEOUT =&gt; 5, // timeout on connect
      CURLOPT_TIMEOUT =&gt; 10, // timeout on response
      CURLOPT_MAXREDIRS =&gt; 3, // stop after 10 redirects
      CURLOPT_SSL_VERIFYHOST =&gt; 0,
      CURLOPT_SSL_VERIFYPEER =&gt; false,
    );
    $ch = curl_init();

    $options[CURLOPT_URL] = $encUrl;  
    curl_setopt_array($ch, $options);

    $content = curl_exec($ch);
    $err = curl_errno($ch);
    $errmsg = curl_error($ch);

    curl_close($ch);

    if ($errmsg != '' || $err != '') {
      /*print_r($errmsg);
      print_r($errmsg);*/
    }
    return $content;
  }
?&gt;
</code></pre>

<p>I get the following error:</p>

<pre><code>Parse error: syntax error, unexpected T_OBJECT_OPERATOR on line 20
</code></pre>

<p>line 20</p>

<pre><code>$json['count'] = str_replace('&gt;', '', $filtered-&gt;item(0)-&gt;nodeValue);
</code></pre>

<p>Any suggestions to help me figure that problem.</p>

<p>Thank you.</p>

<p>This is the link to the file 
<a href="https://bizonbytes.com/miscellaneous/sharrre.php?url=https%3A%2F%2Fbizonbytes.com%2F&amp;type=googlePlus" rel="nofollow">https://bizonbytes.com/miscellaneous/sharrre.php?url=https%3A%2F%2Fbizonbytes.com%2F&amp;type=googlePlus</a></p>

<p>I also have a test file to make sure php is working
<a href="https://bizonbytes.com/miscellaneous/test.php" rel="nofollow">https://bizonbytes.com/miscellaneous/test.php</a></p>

<p>I updated the php version to 5 and it works now when I run 
<a href="http://bizonbytes.com/miscellaneous/sharrre.php" rel="nofollow">http://bizonbytes.com/miscellaneous/sharrre.php</a></p>

<p>but if I try the following
<a href="https://bizonbytes.com/miscellaneous/sharrre.php?url=https%3A%2F%2Fbizonbytes.com%2F&amp;type=googlePlus" rel="nofollow">https://bizonbytes.com/miscellaneous/sharrre.php?url=https%3A%2F%2Fbizonbytes.com%2F&amp;type=googlePlus</a></p>

<p>I get the following error:</p>

<pre><code>Warning: curl_setopt_array() [function.curl-setopt-array]: CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in C:\Inetpub\vhosts\bizonbytes.com\httpdocs\miscellaneous\sharrre.php on line 56
{"url":"https://bizonbytes.com/","count":""}
</code></pre>

<p>I've look inside the ini file and its marked safe_mode = off and I'm not sure what to put for open_basedir</p>
