解析错误:语法错误,意外(T_STRING),预期变量(T_VARIABLE) [英] Parse error: syntax error, unexpected (T_STRING), expecting variable (T_VARIABLE)

查看:97
本文介绍了解析错误:语法错误,意外(T_STRING),预期变量(T_VARIABLE)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果有人能指出错误发生的地方,我将不胜感激.

I will be grateful if someone can point out where the error is occurring.

class hotel extends WishDBxyz{ 
 public nomhotel;
 protected idhotel, ile_idile, pays_idpays, chainehotel_idchainehotel, actif ;
} 

仅在第二行出现了错误Parse错误:语法错误,意外(T_STRING),期望变量(T_VARIABLE).我对面向对象的PHP很陌生,写了一个继承了另一个类的类.

Just on second line got the error Parse error: syntax error, unexpected (T_STRING), expecting variable (T_VARIABLE). I'm quite new to Object Oriented PHP and writting one class inheriting another class.

推荐答案

这些是php中的变量.因此添加 $ 符号:

Those are variables in php.So add the $ sign:

class hotel extends WishDBxyz{ 
 public $nomhotel;
 protected $idhotel, $ile_idile, $pays_idpays, $chainehotel_idchainehotel, $actif ;
}

这篇关于解析错误:语法错误,意外(T_STRING),预期变量(T_VARIABLE)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆