I am practicing with facebook PHP api
when i am trying to make a login function
here comes out this warnning
syntax error, unexpected T_OBJECT_OPERATOR in /home/u528851895/public_html/Desktap/facebook-php-sdk-v4-4.0-dev/src/Facebook/FacebookResponse.php on line 137
but it's ok when i use mamp localhost
here's line 136~138 in FacebookResponse.php:
public function getGraphObject($type = 'Facebook\GraphObject') {
return (new GraphObject($this->responseData))->cast($type);
}
Upgrade your php version or do something like this
public function getGraphObject($type = 'Facebook\GraphObject') {
$obj = new GraphObject($this->responseData);
return $obj->cast($type);
}
Related
Syntax error come at the time of mongodb module installation at Drupal 8.
Error came from modules\contrib\mongodb\modules\mongodb_watchdog\src\Logger.php
protected function countCollection(Collection $collection, array $selector = []): int {
if (version_compare(MongoDb::libraryVersion(), '1.4.0') >= 0) {
return $collection->countDocuments($selector);
}
else {
return $collection->count($selector);
}
}
protected function countCollection(Collection $collection, array
$selector = []): int {
This line make an error
Error: syntax error, unexpected ':', expecting ';' or '{' in
C:\wamp64\www\d8_demo\modules\contrib\mongodb\modules\mongodb_watchdog\src\Logger.php, line 153
I am using PHP 7.1.9 and mongodb 4.2.1
I have no idea about
protected function somemethod(): int {
i am trying to upload my codeigniter website on 000webhost server . but its giving me a syntax error
syntax error, unexpected '[', expecting ')' in
/home/a4703701/public_html/application/controllers/update.php
but its working correct on localhost.
the error is in model my model is
public function user($id=NULL)
{
if($id=='')
{
$q = $this->db->get('user');
if($q->num_rows()>0)
{
return $q;
}
}
else
{
$q = $this->db->get_where('user',['id'=>$id]);
if($q->num_rows()>0)
{
return $q->row();
}
}
}
any idea how to remove this error ?
You're almost certainly not running PHP 5.4 or newer but are trying to use syntax only available in those versions.
['id'=>$id]
is shorthand array syntax and was introduced in PHP 5.4. You need to replace it with:
array('id'=>$id)
to be backwards compatible with prior PHP versions.
This is my integration code:
My extranet is in root/include/ckeditor and root/include/ckfinder
$baseUrl = 'https://extranet.com/crm/include/;
$baseUrl = '/userfiles/';
$baseDir = '/crm/include/userfiles/;
I am trying to do the configuration thats all.
I am trying to integrated with ckeditor but i am getting all sorts of error. Can anyone tell me where iam doing wrong.
It was not possible to properly load the XML response from the web server.
XML Parsing Error: junk after document element Location: https://extranet.zeald.com/crm_snapshot/include/ckfinder/ckfinder.html?CKEditor=message&CKEditorFuncNum=2&langCode=en Line Number 2, Column 1:Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /mnt/clusternfs2/extranet/crm_snapshot/include/ckfinder/core/connector/php/php4/Utils/Misc.php on line 54
^
Raw response from the server:
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /mnt/clusternfs2/extranet/crm_snapshot/include/ckfinder/core/connector/php/php4/Utils/Misc.php on line 54
Edit:
looking into the Misc.php here the code which is giving the error
public static function encodeURIComponent($str)
{
$revert = array('%21'=>'!', '%2A'=>'*', '%27'=>"'", '%28'=>'(', '%29'=>')');
return strtr(rawurlencode($str), $revert);
}
I have got php version 4.3.10 running and I read the ckfinder documentation that version2.2.1 is being supported by php4+.
Edit:
I have removed this code and it seems to be working :
/* public static function encodeURIComponent($str)
{
$revert = array('%21'=>'!', '%2A'=>'*', '%27'=>"'", '%28'=>'(', '%29'=>')');
return strtr(rawurlencode($str), $revert);
} */
Is there a way to make this work.
Hope someone can help me out.
I've gotten my site to run perfectly on my local machine. However, migrating to production, I get roadblocked by "Unexpected T_FUNCTION ..." error.
I've stripped everything prior to the following code and still get the error reported for line 3. I just can't figure this out.
<?php
// Auth Check.
$authCheck = function() use ($app) { <---- Line 3
You are getting :
Parse error: syntax error, unexpected T_FUNCTION in [...][...] on line 4
becasue you are using PHP version less than PHP 5.3.0 upgrade your php or try using globals
PHP 5.3.0+
$app = "Hello Wolrd";
$authCheck = function () use($app) {
echo $app;
};
$authCheck();
Below PHP 5.3.0
$app = "Hello Wolrd";
$authCheck = function () {
global $app;
echo $app;
};
$authCheck();
Both would output
Hello Wolrd
I'm having trouble with Soundcloud.php on my server. Although it runs just fine on my MAMP installation. Basically my test page won't load and an error is logged declaring a problem in Soundcloud.php:
[03-Apr-2012 03:50:57] PHP Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /home2/mysite/public_html/mysubdomain/Soundcloud.php on line 685
the test code is fine - here it is for reference:
<?php
require 'Soundcloud.php';
$soundcloud = new Services_Soundcloud('Client_ID','Client_Secret', 'Redirect_URI');
try {
$info = json_decode($soundcloud->get('tracks', array('user_id' => 'blumarten')), true);
print_r($info);
}
catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) {
exit($e->getMessage());
}
I just had the account upgraded to PHP 5.3 but the error still occurs, any ideas?
SoundCloud PHP API and documentation are very poor and buggy at the moment , hopefully will get better.
Replace this code around line 720
$postData = array_map(function ($track) {
return 'playlist[tracks][][id]=' . $track;
}, $trackIds);
With this:
$postData = array_map("suckySc", $trackIds);
And add this function to the top of the file, before the class opening:
function suckySc ($track){
return 'playlist[tracks][][id]=' . $track;
}