PHP Interview Questions

Frequently Asked PHP Interview Questions:

1. What is PHP?

  • The PHP Hypertext Preprocessor is a programming language that allows web developers to create dynamic content that interacts with databases.
  • PHP is basically used for developing web-based software applications.
  • The PHP code is executed on the server, and the result is returned to the browser as plain HTML
  • PHP files have extension “.php”.
  • PHP runs on all major operating systems(Windows, Linux, Unix, Mac OS X, etc.)
  • PHP supports most of the web servers(Apache, IIS, etc.).
  • Most significant features in PHP is its support for a wide range of databases.

2. What is the Scope Resolution Operator in PHP?

  • The Scope Resolution Operator (also called Paamayim Nekudotayim) or in simpler terms, the double colon.
  • The scope resolution operators are used to access the static, constant, overridden  properties and methods of classes.

Symfony Interview Questions


3. What is PEAR in PHP?

  • PEAR – PHP Extension and Application Repository.
  • PEAR is a framework and distribution system for reusable PHP components. It eases installation by bringing an automated wizard, and packing the strength and experience of PHP users into a nicely organised OOP library.
  • PEAR also provides a command-line interface that can be used to automatically install “packages”.

Laravel Interview Questions

4. What’s the difference between the include() and require() functions?

include() and require() both are used to include a file but when you include file using require() and then file does not exist then it will give the fatal error and stop the execution of script while include() only gives warning and script will continue.