PHP Interview Questions and Answers
Some PHP interview questions and answers-
Question 1. Who is the father of PHP language?
Answer : Programmer Rasmus Lerdorf is the father of PHP (general-purpose scripting) language.
Question 2. What is the full form of PHP originally stand for?
Answer : PHP stands for Personal Home Page, but it now stands for Hypertext Preprocessor.
It is general-purpose scripting language.
Question 3. Is PHP a case sensitive language?
Answer : PHP is Not fully case sensitive language. It is partly a case sensitive language. But variable names are case-sensitive.
Question 4. What are the most popular frameworks in PHP?
Answer : Some PHP frameworks are given bellow –
- CakePHP, CodeIgniter (CI), Zend Framework and Symfony.
Question 5. What are most popular Content Management Systems (CMS) in PHP?
Answer : WordPress(WP), Magneto, Drupal and Joomla.
Question 6. What is NULL in PHP?
Answer : NULL is a particular type of value in PHP. It represents a variable with no value and is usually used to denote the absence of a deal.
Question 7. What is the null function in PHP?
Answer : In PHP, is_null() function checks whether a variable is NULL or not. if the variable is NULL then this function returns true (1) and if the variable is not NULL then it returns nothing/false.
Example –
<?php
$a = 0;
$b = NULL
is_null($a); // it returns nothing/false
is_null($b); // it returns 1
?>
Question 8. What are the differences between PHP variables & constants?
Answer :
- PHP constants and variables differences in their scope.
- PHP constants are global, means they are accessible in whole an application, while variables are only accessible in the area where they were defined.
- PHP constants must be explicitly defined before they can be used, while variables can be used without initializing.
Question 9. How many types of variables in PHP?
Answer : PHP has three different variable in scopes: local, global & static.
Question 10. How many Data Types in PHP?
Answer : There are 8 data types variables used in PHP –
- Integers, Doubles (floating-point numbers), Boolean’s, Strings, NULL, Arrays, Objects and Resources.
Good Sir, Important Interview qes and ans for fresher.