Answers

Question and Answer:

  Home  Senior PHP Programmer

⟩ In a PHP class what are the three visibility keywords of a property or method?

public, private and protected. The default is public.

Public -> Any class may instantiate the class and call the method or property.

Protected -> Only the class itself or inherited (children) classes may call a method or property.

Private -> Only the class itself may call a method or property.

 198 views

More Questions for you: