My code was working fine in php 5.3.2-1 on ubuntu. I recently ported it to windows with XAMPP installed in it. It uses php 5.3.8 . I am getting error.
Non-static method Following::getUpdates() should not be called statically, assuming $this from incompatible context
What is way to go?
Shall i correct my code to replace declaration at each place in code OR
Is there way to simulate the old behavior(php 5.3.2 with php.ini file) because i am not sure how much more error will be thrown at my face after correcting it.
UPDATE (code sample)
public function actionIndex(){
if(yii::app()->user->isGuest){
$this->render('guestIndex');
}
else{
$dataProvider = Following::getUpdates(yii::app()->user->id); //genrerate data for the homepage of user i.e updates from followers
$this->render('userIndex',array('dataProvider'=>$dataProvider));
}
}
Getting the error on line $dataProvider = Following::getUpdates(yii::app()->user->id);
I am using yii framework.
Your new installation likely just includes
E_STRICTwarnings while your previous installation didn’t. Quoting the manual:This implies you can get rid of the warnings by disabling
E_STRICTin your error reporting, but IMO you should fix the offending code.