final
The methods or classes can not be modified by a child class. This prevents class inheritance, method-overriding and/or redefinition of methods.
Only class definitions and/or methods inside a class can be defined as
final
.
static
Declares class methods or properties as a static value so that you have access to them without instantiating an object. These are shared between parent and child-classes.
A class definition can not be
static
unlikefinal
.
const
These create a constant value for a class. The constant values will get changed and can NOT be changed by a method in either parent or child-class.
Class constants are allocated per instance of the class.
const
is a type specifier in itself. It can not be put along with
public
/private
/static
etc. final
, as mentioned before can be used along with any method or class definitions and hence; applicable with all of them. static
can not be applied to class definitions but can be used for class properties.
UPDATE
modifiers are allowed for class constants since PHP 7.1.0.
class Foo { public const bar = 5; private const baz = 6; }
To summarise,
final static
can not be used to define something like:class X { final static x = 5; }
which is why you have a
const
.