网站运行时报错:Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting T_STRING or T_VARIABLE or '$' in E:\PHPnow-1.5.6\htdocs\source\action\index\action.user.php on line 51
第51行代码是unset ("service") ;
代码如下:
private function _unset( )
{
unset ("service") ;
} private function _getListItems( )
第51行代码是unset ("service") ;
代码如下:
private function _unset( )
{
unset ("service") ;
} private function _getListItems( )
如果是private $service = 'service';
释放变量就是这样
unset ($this->service) ;
private function _new( )
{
$this->service = parent::service( "user", "is" );
} private function _unset( )
{
unset( ['service'] );
}
private $service = NULL;
$this->service = parent::service( "user", "is" );
为什么就不知道
$this->service = null;
unsettling($this->service);
...
呢?
unsettling($this->service);
这样还是不行,报错:Fatal error: Call to undefined function unsettling() in E:\PHPnow-1.5.6\htdocs\source\action\index\action.user.php on line 52
改成this->service = null;
unset($this->service);这样也报错:Catchable fatal error: Object of class userIService could not be converted to string in E:\PHPnow-1.5.6\htdocs\source\model\index\model.user.php(2) : eval()'d code(1) : eval()'d code(1) : eval()'d code on line 46
46行的代码:$this->service = parent::service( "user", "is" );
if ( !defined( "IN_OESOFT" ) )
{
exit( "Access Denied" );
}
class userIAction extends control
{ private $service = NULL;
private $_tplfile = NULL;
private $type = NULL;
private $s_uid = 0;
private $s_username = NULL;
private $s_sex = 0;
private $s_sage = 0;
private $s_eage = 0;
private $s_dist1 = 0;
private $s_dist2 = 0;
private $s_dist3 = 0;
private $s_lovesort = 0;
private $s_sheight = 0;
private $s_eheight = 0;
private $s_ssalary = 0;
private $s_esalary = 0;
private $s_sedu = 0;
private $s_eedu = 0;
private $s_marry = NULL;
private $s_havechild = NULL;
private $s_house = 0;
private $s_car = 0;
private $s_avatar = 0;
private $comsql = NULL;
private $countsql = NULL;
private $_urlitem = NULL; private function _new( )
{
$this->service = parent::service( "user", "is" );
} private function _unset( )
{
unset( ['service'] );
} private function _getListItems( )
{
$this->_new( );
$this->type = $this->service->validType( );
$this->s_uid = $this->service->validUid( );
$this->s_username = $this->service->validUserName( );
list( , $args ) = $this->service->validSearch( );
$this->countsql = $this->service;
list ) = $this->service->validSearch( );
$this->comsql = $this->service;有错的在51行,代码:unset( ['service'] );
if ( !defined( "IN_OESOFT" ) )
{
exit( "Access Denied" );
}
class connectIAction extends control
{ private $service = NULL;
private $id = NULL;
private $oauth = array( ); private function _new( )
{
$this->service = parent::service( "connect", "is" );
} private function _unset( )
{
unset( ['service'] );
} private function _getDetailItems( )
{
$this->_new( );
$this->id = $this->service->validID( );
$this->_unset( );
$connect_model = parent::model( "connect", "im" );
$this->oauth = $connect_model->getOneData( $this->id );
unset( $connect_model );
if ( empty( $this->oauth ) )
{
XHandle::halt( "载入Oauth配置信息失败!", "", 1 );
}
else if ( !in_array( $this->oauth['sdkname'], array( "qq", "sina", "kaixin", "renren" ) ) )
{
XHandle::halt( "载入不允许的登录Module ".$this->oauth['sdkname']."" );
}
} public function action_login( )
{
$this->_getDetailItems( );
$model_sdk = parent::model( $this->oauth['sdkname'], "im" );
$model_sdk->_get( $this->oauth );
$model_sdk->doSubmit( );
unset( $model_sdk );
} public function action_callback( )
{
$this->_getDetailItems( );
$model_sdk = parent::model( $this->oauth['sdkname'], "im" );
$model_sdk->_get( $this->oauth );
$model_sdk->doCallBack( );
unset( $model_sdk );
}}有错的在28行,代码是:unset( ['service'] ); ,怎样修改?