Hailwood Posted February 10, 2010 Share Posted February 10, 2010 hey guys. What is the significance of the _ eg $_varname; is it like an internal variable or something? Quote Link to comment https://forums.phpfreaks.com/topic/191577-oop-variables-_varname/ Share on other sites More sharing options...
Catfish Posted February 10, 2010 Share Posted February 10, 2010 http://stackoverflow.com/questions/663350/whats-the-deal-with-a-leading-underscore-in-php-class-methods i use a leading underscore in my code for function parameter variables so they are easy to identify. Quote Link to comment https://forums.phpfreaks.com/topic/191577-oop-variables-_varname/#findComment-1009884 Share on other sites More sharing options...
Alex Posted February 10, 2010 Share Posted February 10, 2010 Typically beginning a variable name with an underscore is used to denote private properties. Quote Link to comment https://forums.phpfreaks.com/topic/191577-oop-variables-_varname/#findComment-1009913 Share on other sites More sharing options...
Mchl Posted February 10, 2010 Share Posted February 10, 2010 Note however, that the underscore has no significance for PHP interpreter. It's just visual aid for people reading the code. Quote Link to comment https://forums.phpfreaks.com/topic/191577-oop-variables-_varname/#findComment-1009929 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.