cwncool Posted May 26, 2007 Share Posted May 26, 2007 Can someone please tell me the different class variable types, and when to use them? Like what's the difference between just stating "var $hello" and "public $hello" or "private $hello". I know what public and private mean, but like to what does the public and private apply to, etc.? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/53087-different-variable-types/ Share on other sites More sharing options...
448191 Posted May 26, 2007 Share Posted May 26, 2007 These are not variable types, these are visbility indicators. "var" idicates a property in php5 and equals php5's "public" (though depreciated, "var" works in php5 too). http://www.phpfreaks.com/tutorials/150/2.php#2.5 Quote Link to comment https://forums.phpfreaks.com/topic/53087-different-variable-types/#findComment-262247 Share on other sites More sharing options...
448191 Posted May 26, 2007 Share Posted May 26, 2007 "var" indicates a property in php4. Would've used edit, if it we're available. :-\ Quote Link to comment https://forums.phpfreaks.com/topic/53087-different-variable-types/#findComment-262263 Share on other sites More sharing options...
cwncool Posted May 27, 2007 Author Share Posted May 27, 2007 Ohh. Okay. Thanks for clearing that up. I'll just stick with 'var' for possible server issues. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/53087-different-variable-types/#findComment-262373 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.