At 01:12 6-4-2003, you wrote:
Does anyone know of a prefix convention used for PHP? What I'm talking about is using a type of Hungarian notation for PHP variables. I know they use 'g', 'm', and 'r' for global, method and reference variables but for other variable types. I get confused once and a while, while I am coding and want to make things clearer than mud...

In a nutshell: it is entirely up to you.


There are some coding standards out there, but there is not such as thing as The Standard. You might be interested in reading
http://pear.php.net/manual/en/standards.php (coding standards) with as a paragraph of it http://pear.php.net/manual/en/standards.naming.php (naming conventions, but as far as i see it does not go much further than
$_UNDERSCORE_WITH_CAPITALS means it is global. )


or another site:
http://utvikler.start.no/code/php_coding_standard.html#stacknames.

I can see the use of such conventions especially when you are working in a group.

And when you are combining several applications, it is very usefull if the global variables are called $APP1_name and $APP2_name in stead of both being called $name.... That's why module developers in the nuketype CMSes are asked not to use globals and if they must, use reserved prefixes.


In VBA conventions are much stricter, and go a bit in your direction, e.g. strname would be a string variable. I found some sites, http://www.triadconsulting.com/Resources/Reddick.htm and http://www.mvps.org/access/general/gen0012.htm, that list their standards.





Chris







-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to