Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the naming rules of legal names in php

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces what are the naming rules of legal names in php. What is introduced in the article is very detailed and has a certain reference value. Friends who are interested must read it!

Naming rules for legal names in php: the first letter of the first word of the method name should be lowercase, and the first letter of the subsequent word should be capitalized. The first character of the parameter name in the method is lowercase, and all subsequent characters are capitalized according to the class naming convention.

This article operating environment: windows10 system, php 7, thinkpad T480 computer.

In PHP, the function of a method is to perform an action to achieve a goal, so the name should indicate what the method does.

The prefixes of general method names have the first rule, such as is (judge), get (get), set (setting) and so on.

Method naming rules:

The first letter of the first word is lowercase and the first letter of the subsequent word is capitalized.

For example:

Class StartStudy {/ / set class $mLessonOne = ""; / / set class property $mLessonTwo = ""; / / set class property function getLessonOne () {/ / define method to get the value of property mLessonOne.}}

The naming rules for the parameters in the

The first character uses lowercase letters. All characters after the first character are capitalized according to the class naming convention.

For example:

Class EchoAnyWord {function echoWord ($firstWord,$secondWord) {...}} these are all the contents of this article entitled "what are the naming rules of legal names in php". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report