BK201 Posted June 1, 2012 Share Posted June 1, 2012 Maybe I'm just missing something but I'm completely dumbfounded atm.. Parse error: syntax error, unexpected T_CLASS, expecting T_PAAMAYIM_NEKUDOTAYIM <?php static class Items { private $_weapons = array( ["Wood Axe"] => 10 ); private $_armor = array(); private $_shields = array(); private $_helmets = array(); private $_boots = array(); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/263486-expecting-scope-resolution-operator/ Share on other sites More sharing options...
trq Posted June 1, 2012 Share Posted June 1, 2012 Remove the [] from around the string "Wood Axe" Quote Link to comment https://forums.phpfreaks.com/topic/263486-expecting-scope-resolution-operator/#findComment-1350296 Share on other sites More sharing options...
kicken Posted June 1, 2012 Share Posted June 1, 2012 You can't declare a whole class as 'static'. Only individual member variables or functions. Remove the static from your class definition and apply it to whichever members need it (if any). Quote Link to comment https://forums.phpfreaks.com/topic/263486-expecting-scope-resolution-operator/#findComment-1350300 Share on other sites More sharing options...
trq Posted June 1, 2012 Share Posted June 1, 2012 Ha, I didn't even see that. I guess I should have read the topic. Quote Link to comment https://forums.phpfreaks.com/topic/263486-expecting-scope-resolution-operator/#findComment-1350301 Share on other sites More sharing options...
BK201 Posted June 1, 2012 Author Share Posted June 1, 2012 Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/263486-expecting-scope-resolution-operator/#findComment-1350302 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.