Basic PHP Interview Questions

Basic PHP Interview Questions
There is given PHP interview questions and answers that have been asked in many companies. Let's see the list of top PHP interview questions.
What is PHP?

PHP is an open-source, interpreted, and object-oriented scripting language that can be executed at the server-side. PHP is well suited for web development. Therefore, it is used to develop web applications (an application that executes on the server and generates the dynamic page.).

PHP was created by Rasmus Lerdorf in 1994 but appeared in the market in 1995. PHP 7.4.0 is the latest version of PHP, which was released on 28 November. Some important points need to be noticed about PHP are as followed:

PHP stands for Hypertext Preprocessor.
PHP is an interpreted language, i.e., there is no need for compilation.
PHP is faster than other scripting languages, for example, ASP and JSP.
PHP is a server-side scripting language, which is used to manage the dynamic content of the website.
PHP can be embedded into HTML.
PHP is an object-oriented language.
PHP is an open-source scripting language.
PHP is simple and easy to learn language.
2) What is PEAR in PHP?
PEAR is a framework and repository for reusable PHP components. PEAR stands for PHP Extension and Application Repository. It contains all types of PHP code snippets and libraries.



It also provides a command line interface to install "packages" automatically.

3) Who is known as the father of PHP?
Rasmus Lerdorf

4) What was the old name of PHP?
The old name of PHP was Personal Home Page.

5) Explain the difference b/w static and dynamic websites?
In static websites, content can't be changed after running the script. You can't change anything on the site. It is predefined.

In dynamic websites, content of script can be changed at the run time. Its content is regenerated every time a user visit or reload. Google, yahoo and every search engine is the example of dynamic website.

6) What is the name of scripting engine in PHP?
The scripting engine that powers PHP is called Zend Engine 2.

7) Explain the difference between PHP4 and PHP5.
PHP4 doesn't support oops concept and uses Zend Engine 1.

PHP5 supports oops concept and uses Zend Engine 2.


8) What are the popular Content Management Systems (CMS) in PHP?
WordPress: WordPress is a free and open-source content management system (CMS) based on PHP & MySQL. It includes a plug-in architecture and template system. It is mostly connected with blogging but supports another kind of web content, containing more traditional mailing lists and forums, media displays, and online stores.
Joomla: Joomla is a free and open-source content management system (CMS) for distributing web content, created by Open Source Matters, Inc. It is based on a model-view-controller web application framework that can be used independently of the CMS.
Magento: Magento is an open source E-trade programing, made by Varien Inc., which is valuable for online business. It has a flexible measured design and is versatile with many control alternatives that are useful for clients. Magento utilizes E-trade stage which offers organization extreme E-business arrangements and extensive support network.
Drupal: Drupal is a CMS platform developed in PHP and distributed under the GNU (General Public License).
9) What are the popular frameworks in PHP?
CakePHP
CodeIgniter
Yii 2
Symfony
Zend Framework etc.
10) Which programing language does PHP resemble to?
PHP has borrowed its syntax from Perl and C.

11) List some of the features of PHP7.
Scalar type declarations
Return type declarations
Null coalescing operator (??)
Spaceship operator
Constant arrays using define()
Anonymous classes
Closure::call method
Group use declaration
Generator return expressions
Generator delegation
Space ship operator

What's Your Reaction?

like
1
dislike
0
love
0
funny
0
angry
0
sad
0
wow
1