Why do some people call their functions e.g. '__makethis()' and '_makethat()'?
Is this any special feature or is this just in fashion?
thx for your answers ;)
Note: A function name must start with a letter or an underscore. Function names are NOT case-sensitive.
Function name of C follow the same naming conventions as declaring variable. It can either start with an alphabet or an underscore.
In PHP, class names as well as function/method names are case-insensitive, but it is considered good practice to them functions as they appear in their declaration.
the "@" will silence any php errors your function could raise. Follow this answer to receive notifications.
The double underscore can sometimes be magic functions used by the PHP classes.
The single underscore can be part of their own naming convention for functions. But usually it means that a function is private, back in PHP4 classes didn't support private (or protected) functions, so people fake a private function that way (tho the function is not private in reality).
That's a convention for naming private and protected methods.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With