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? 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. 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. 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. Link to comment https://forums.phpfreaks.com/topic/191577-oop-variables-_varname/#findComment-1009929 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.