PHP Multiple choices


Total available count: 47
Subject - PHP Frameworks
Subsubject - PHP

In which version final keyword is available in PHP?


 

 

 

 



C


Solution:-

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{};
?>



Next 5 multiple choice(s)

1

Does PHP support multiple inheritance?

2

Pick the difference between PHP 4 and PHP 5?

3

How to run the interactive PHP shell from the command line interface?

4

How will we execute a PHP script from the Command line?

5

Which operator is used to check if two values are equal and of the same data type?

Comments