jxrd Posted June 1, 2009 Share Posted June 1, 2009 I was just wondering, is there a way to make variables retain their value after new calls to their parent class? So for example: class something { var $something; } $something = new something; $something->something = 'yo'; $something = new something; // now something::$something is wiped Any info would be awesome. Thanks. Link to comment https://forums.phpfreaks.com/topic/160533-solved-quick-variables-question/ Share on other sites More sharing options...
Ken2k7 Posted June 1, 2009 Share Posted June 1, 2009 You'll have to make the variable $something static. And it's not, so I don't know what you mean by something::$something is wiped. Link to comment https://forums.phpfreaks.com/topic/160533-solved-quick-variables-question/#findComment-847221 Share on other sites More sharing options...
jxrd Posted June 1, 2009 Author Share Posted June 1, 2009 Yeah, makes sense. Stupid of me...tired. Thanks. Link to comment https://forums.phpfreaks.com/topic/160533-solved-quick-variables-question/#findComment-847298 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.