In which version final keyword is available in PHP?
As like as other programming languages, like, Java, the final keyword is added into PHP as of its version 5. This keyword is used as a modifier, but only applicable for PHP classes and functions.
The final keyword is used to prevent a class from being inherited and to prevent an inherited method from being overridden.
Example
The following example prevents inheritance of a class using the final keyword:
<?php
final class MyClass {
public $website = "Slight Book";
}
// This code will throw an error
class AnotherClass extends MyClass{};
?>
Does PHP support multiple inheritance?
Pick the difference between PHP 4 and PHP 5?
How to run the interactive PHP shell from the command line interface?
How will we execute a PHP script from the Command line?
Which operator is used to check if two values are equal and of the same data type?