I'm Getting Weird Error (Unexpected T_Paamayim_Nekudotayim)

First time I encountered this kind of error. My code is as below:




if ($model->blog_status == MyBlog::$STATUS_NEW ||

    $model->blog_status == MyBlog::$STATUS_DRAFT) {

    if ($model->blog_status == MyBlog::$STATUS_NEW) {

	echo CHtml::submitButton('', array(

	'name'=>$this::$SAVE_AS_DRAFT, 'title'=>'Save as Draft', 'class'=>'button-draft',

	'onclick'=>'return confirm(\'Are you sure you want to Save as Draft?\')',

	));

    }

    echo CHtml::submitButton('', array(

	'name'=>$this::$SUBMIT, 'title'=>'Submit', 'class'=>'button-save',

	'onclick'=>'return beforeSubmit(\'Are you sure you want to Submit?\');',

	));

}



This code works on my local machine however when I try to run my code in my production server…I keep on getting the error “Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting ')…”

Please help…Thanks!

PAAMAYIM_NEKUDOTAYIM is ::

$this::$SAVE_AS_DRAFT looks wrong.

True. It should either be self::$SAVE_AS_DRAFT (static call) or $this->$SAVE_AS_DRAFT.

T_Paamayim_Nekudotayim is an arrow operator(->) this is the error i think check it out your code:-)

It’s not arrow, it’s ::

It’s not C++, it’s PHP.

oh thanks buddy

I am also getting this error on my site. It only occurs on live site, works very well with local server.

How can i solve it - “Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting ')…” ?

Is there any logic behind it?

There should be. Check PHP version differences between your server and your local environment.