Repository navigation
Modifier Reference
Applicable to: Fields, Methods
Can be accessed from anywhere regardless of context.
Applicable to: Fields, Methods
Protected fields and methods are private unless accessed from a class that inherits it or from any implementing methods in an anonymous instance. Protected fields can also be set by key in the new instance section.
Applicable to: Fields, Methods
This is the strictest access type. Private fields and methods can only be accessed from within the exact class they were defined in.
Applicable to: Fields, Methods
Static means that a field/method is scoped into a particular class, but does not belong to any particular instance.
Instead of specifying an instance in the call, you just write the class name. For example: ClassName::methodName()
Applicable to: Methods
When extending a class, use this keyword to specify methods you want to override the behavior of. It will error if a method would override but does not have this keyword.
Applicable to: Classes, Methods
If a class is marked 'abstract', its methods can be implemented anonymously. It may also contain abstract methods which must be implemented by any future inheritors.
Applicable to: Fields
Constant fields can only be defined as default values or in the new instance section when creating an instance. After this they can't be set anymore.
Applicable to: Classes, Methods
Final methods cannot be overridden by inheritors, regardless of access type. Final classes can't be extended at all.