doddsey_65 Posted July 14, 2011 Share Posted July 14, 2011 im getting the double colon error on this line: if(logged_in($user::$data['u_uid'])) $user is defined as new sessionsClass and $data is a public static variable which holds all the user information. So why am i getting this error? it works fine locally. Quote Link to comment https://forums.phpfreaks.com/topic/241948-unexpected-t_paamayim_nekudotayim/ Share on other sites More sharing options...
trq Posted July 14, 2011 Share Posted July 14, 2011 Static variables belong to the class not an object, if(logged_in(sessionsClass::$data['u_uid'])) Quote Link to comment https://forums.phpfreaks.com/topic/241948-unexpected-t_paamayim_nekudotayim/#findComment-1242564 Share on other sites More sharing options...
salathe Posted July 14, 2011 Share Posted July 14, 2011 it works fine locally. I'm going to guess that "locally" you're using PHP 5.3 and "not locally" you're using PHP 5.2 (or lower). The former allows you to use a variable as you have, the latter does not. In short, prior to PHP 5.3.0 you must hard code the class name there. Quote Link to comment https://forums.phpfreaks.com/topic/241948-unexpected-t_paamayim_nekudotayim/#findComment-1242593 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.