Z
Z
Z_Coder2014-02-03 21:01:32
Yii
Z_Coder, 2014-02-03 21:01:32

How to fix "Parse error: syntax error, unexpected '.', expecting ',' or ';'" "?

Hello. I have a trace. the code:

class Process extends CModel{
  public $path1 = __DIR__.'/files/config.txt';
}

Crashes when using. error:
Parse error: syntax error, unexpected '.', expecting ',' or ';'
Question: What syntax error did I make?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Zakharov, 2014-02-03
@Z_Coder

when you declare a property, you are trying to perform an action - string concatenation.
this is done in methods

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question