Interview Questions for PHP developer

Here are some of the interview questions asked during the interview session of PHP developer .

1) What is PHP?

PHP is Hypertext Pre processor. It is one of the script language that is used on Linux Web servers. It can be embedded in HTML and used for web development.

2) What is the old name of PHP?

PHP stands for Personal Home Page.

3) What is PEAR in PHP?

PEAR stands for “PHP Extension and Application Repository”.  PEAR acts as open-source code library in PHP development, gives code and maintains collection.

4) Who is the father of  PHP?

Rasmus Lerdorf  known as father of PHP. He created PHPin the year 1994.

5) Tell me the differences between static and dynamic websites?

Static site

  • Static site is written in plain HTML.
  • The content in the code of the page will be displayed to the user.

Dynamic site

  • Dynamic site uses server-side scripting language like PHP, ASP and Coldfusion for writing.
  • For Dynamic site, content from other databases are taken and written whenever needed by the user.

6) Tell me name of the scripting engine in PHP?

Zend Engine.  It is the open source scripting engine which describes the PHP programming language.  The Zend Engine’s first version appeared in PHP version in the year 1999. This was written in C and used in applications other than PHP.

7) What are the loops in PHP?

The Loops make the reoccurring tasks again and again within a program to conserve the time and work.
PHP uses four types of loops.

1)While – this loops till condition mention becomes true.
2) do..while – With codes executes once and then condition gets evaluated. The statement repeats till the condition becomes true.
3) For – this loops till the counter achieves a certain number.
4) foreach – for array’s each element, it loops for block of code.

8)  Tell me the display the output directly to the browser?

To display output in Browser, use the special tags <?= and  ?> .

9) Mention the programming language do PHP parallels?

 Perl and C

10)  Tell the way to create a  MySQL connection?

mysql_connect(servername, username, password)

11) Tell me about the errors that occur in PHP?

1) Notices
Small errors occurs during the execution of script. PHP will not display the errors
to the user.
2) Warnings
This error tries to include() a file that does not exists. PHP displays this error.
3) Fatal Errors
This error terminates the script as soon it occurs. PHP will display this error.