Parse error: Syntax error, unexpected end of file in my PHP code

后端 未结 16 1925
孤城傲影
孤城傲影 2020-11-22 05:27

I got an error:

Parse error: syntax error, unexpected end of file in the line

With this code:


    

        
16条回答
  •  梦如初夏
    2020-11-22 05:45

    Check that you closed your class.

    For example, if you have controller class with methods, and by accident you delete the final bracket, which close whole class, you will get this error.

    class someControler{
    private $varr;
    public $varu;
    ..
    public function method {
    ..
    } 
    ..
    }// if you forget to close the controller, you will get the error
    

提交回复
热议问题