douyuqing_12345 2015-04-28 15:31
浏览 120
已采纳

PHP语法错误,意外T_STRING

I'm using cakephp and php 5.3 and just recently I keep getting this weird error i'm not sure why :

Error: syntax error, unexpected T_STRING, expecting T_FUNCTION File: /Applications/AMPPS/www/gestionstock/server/app/Model/Work.php Line: 2

here is the content of the file Work.php :

<?php 
 class Work extends AppModel{ 
    public $hasOne = array("Projet" , "Salarie" , "Ville") ; 
}
  • 写回答

1条回答 默认 最新

  • duanbi2760 2015-05-03 15:09
    关注

    It turned out this error was generated because there was a space ' ' after { in line 2;

    I'm not sure why this is an error , but removing the space solved my problem.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?