Category: PHP Interview Question
-
What are superglobals in PHP?
Superglobal variables in PHP are predefined global variables. Global variables are accessible from any part of a PHP script. Some examples of superglobal variables are $_GET, $_POST, $_REQUEST, $_FILES, $_COOKIE, $_SESSION, $_SERVER, $_ENV, and $GLOBALS.
-
What is the difference between == and === operators in PHP?
“==” operator is used to check two values without checking datatypes. “===” operator is used to do a strict check that also checks for datatypes along with values
-
What are constants in PHP, and what is the syntax to define them?
In PHP, constants are like variables that cannot be changed during the execution of the script. They are used to store values that remain constant throughout the execution. Ex. 1234 define(name, value, case-insensitive);Where, name = name of the constantvalue = value of the constantCase-sensitive takes in a boolean value
-
Explain the PHP request-response cycle.
The PHP request-response cycle is a concept that explains how a web application processes incoming requests and generates responses that are later sent to the client.
-
What is PHP?
PHP stands for Hypertext Preprocessor. It is an open-source, general-purpose, scripting language that is especially used for web development.
-
What are some of the popular frameworks in PHP?
There are many frameworks in PHP that are known for their usage. Following are some of them:
-
Differentiate between PHP4 and PHP5.
PHP4 PHP5 No support for static methods Allows the usage of static methods Abstract classes cannot be declared Abstract classes can be declared The method of call-by-value is used The method of call-by-reference is used Constructors can have class names Constructors have separate names
-
What does the phrase ‘PHP escape’ mean?
PHP escape is a mechanism that is used to tell the PHP parser that certain code elements are different from the PHP code. This provides the basic means to differentiate a piece of PHP code from the other aspects of the program.
-
What are the main characteristics of a PHP variable?
Following are some of the most important aspects of the usage of variables in PHP: Next up on these PHP interview questions for freshers, you need to understand what NULL is.