Which one of the following is not a valid class name?
Correct answer
D. 1shopproduct
10 views
D. 1shopproduct
10 views
1shopproduct is not a valid class name because PHP class names must begin with a letter or an underscore — never a digit. After the first character, letters, digits and underscores are all allowed.
That is why ShopProduct, Shopproduct and Shopproduct1 are all acceptable. Class names are also case-insensitive in PHP, although consistent StudlyCaps naming is the accepted convention.
Keep preparing with more Computer Science MCQs on MCQsExam.com.
Not sure why the answer is D? Ask here and get an explanation.