facebook - Yet another PHP Parse error: syntax error, unexpected 'use' (T_USE) -


i lost evening on , feel need other check this, i'm blind.

define('facebook_sdk_v4_src_dir', '/var/www/rateanything/facebook-sdk/src/facebook'); require('/var/www/rateanything/facebook-sdk/autoload.php'); use facebook; facebooksession::setdefaultapplication('my_app_id', 'my_app_secret'); $session = new facebooksession($fbtoken); $request = new facebookrequest($session,'get','/me?fields=email,name,gender'); 

why not duplicate: because question has not error. i'm getting parse error.

i'm using php 5.4.

is code wrapped inside function? use keyword can applied on outermost scope of file.

basically, move use facebook; top of file.

alternatively, reference namespace in facebooksession , facebookrequest defined. so:

define('facebook_sdk_v4_src_dir', '/var/www/rateanything/facebook-sdk/src/facebook'); require('/var/www/rateanything/facebook-sdk/autoload.php'); facebook\facebooksession::setdefaultapplication('my_app_id', 'my_app_secret'); $session = new facebook\facebooksession($fbtoken); $request = new facebook\facebookrequest($session,'get','/me?fields=email,name,gender'); 

Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

order - Notification for user in user account opencart -