I'm Getting Weird Error (Unexpected T_Paamayim_Nekudotayim)


(Erikcute) #1

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!


(Alexander Makarov) #2

PAAMAYIM_NEKUDOTAYIM is ::

$this::$SAVE_AS_DRAFT looks wrong.


(Da:Sourcerer) #3

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


(Rifajas) #4

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


(Alexander Makarov) #5

It’s not arrow, it’s ::


(Jacob Moen) #6

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


(Rifajas) #7

oh thanks buddy


(Archdude4458) #8

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?


(Alexander Makarov) #9

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