PHP Interview Questions

 
1.
What is PHP?
2.
What does the initials of PHP stand for?
3.
Which programming language does PHP resemble to?
4.
What does PEAR stands for?
5.
What is the actually used PHP version?
6.
How do you execute a PHP script from the command line?
7.
How to run the interactive PHP shell from the command line interface?
8.
What are the correct and the most two common way to start and finish a PHP block of code?
9.
How can we display the output directly to the browser?
10.
What is the main difference between PHP 4 and PHP 5?
11.
Is multiple inheritance supported in PHP?
12.
What is the meaning of a final class and a final method?
13.
How comparison of objects is done in PHP5?
14.
How can PHP and HTML interact?
15.
What type of operation is needed when passing values through a form or an URL?
16.
How can PHP and Javascript interact?
17.
What is needed to be able to use image function?
18.
What is the use of the function `imagetypes()'?
19.
What are the functions to be used to get the image's properties (size, width and height)?
20.
How failures in execution are handled with include() and require() functions?
21.
What is the main difference between require() and require_once()?
22.
How can I display text with a PHP script?
23.
How can we display information of a variable and readable by human with PHP?
24.
How is it possible to set an infinite execution time for PHP script?
25.
What does the PHP error `Parse error in PHP - unexpected T_variable at line x' means?
26.
What should we do to be able to export data into an Excel file?
27.
What is the function file_get_contents() usefull for?
28.
How can we connect to a MySQL database from a PHP script?
29.
What is the function mysql_pconnect() usefull for?
30.
How the result set of Mysql be handled in PHP?
31.
How is it possible to know the number of rows returned in result set?
32.
Which function gives us the number of affected entries by a query?
33.
What is the difference between mysql_fetch_object() and mysql_fetch_array()?
34.
How can we access the data sent through the URL with the GET method?
35.
How can we access the data sent through the URL with the POST method?
36.
How can we check the value of a given variable is a number?
37.
How can we check the value of a given variable is alphanumeric?
38.
How do I check if a given variable is empty?
39.
What does the unlink() function means?
40.
What does the unset() function means?
41.
How do I escape data before storing it into the database?
42.
How is it possible to remove escape characters from a string?
43.
How can we automatically escape incoming data?
44.
What does the function get_magic_quotes_gpc() means?
45.
Is it possible to remove the HTML tags from data?
46.
what is the static variable in function useful for?
47.
How can we define a variable accessible in functions of a PHP script?
48.
How is it possible to return a value from a function?
49.
What is the most convenient hashing method to be used to hash passwords?
50.
Which cryptographic extension provide generation and verification of digital signatures?
51.
How a constant is defined in a PHP script?
52.
How can you pass a variable by reference?
53.
Will a comparison of an integer 12 and a string "13" work in PHP?
54.
How is it possible to cast types in PHP?
55.
When a conditional statement is ended with an endif?
56.
How is the ternary conditional operator used in PHP?
57.
What is the function func_num_args() used for?
58.
If the variable $var1 is set to 10 and the $var2 is set to the character var1, what's the value of $$var2?
59.
What does accessing a class via :: means?
60.
In PHP, objects are they passed by value or by reference?
61.
Are Parent constructors called implicitly inside a class constructor?
62.
What's the difference between __sleep and __wakeup?
63.
What is faster?
64.
what is the definition of a session?
65.
How to initiate a session in PHP?
66.
How is it possible to propagate a session id?
67.
What is the meaning of a Persistent Cookie?
68.
When sessions ends?
69.
What is the difference between session_unregister() and session_unset()?
70.
What does $GLOBALS means?
71.
What does $_SERVER means?
72.
What does $_FILES means?
73.
What is the difference between $_FILES['userfile']['name'] and $_FILES['userfile']['tmp_name']?
74.
How can we get the error when there is a problem to upload a file?
75.
How can we change the maximum size of the files to be uploaded?
76.
What does $_ENV means?
77.
What does $_COOKIE means?
78.
What does the scope of variables means?
79.
what the difference between the `BITWISE AND' operator and the `LOGICAL AND' operator?
80.
What are the two main string operators?
81.
What does the array operator `===' means?
82.
What is the differences between $a != $b and $a !== $b?
83.
How can we determine whether a PHP variable is an instantiated object of a certain class?
84.
What is the goto statement useful for?
85.
what is the difference between Exception::getMessage and Exception::getLine ?
86.
What does the expression Exception::__toString means?
87.
How is it possible to parse a configuration file?
88.
How can we determine whether a variable is set?
89.
What is the difference between the functions strstr() and stristr()?
90.
what is the difference between for and foreach?
91.
Is it possible to submit a form with a dedicated button?
92.
What is the difference between ereg_replace() and eregi_replace()?
93.
Is it possible to protect special characters in a query string?
94.
What are the three classes of errors that can occur in PHP?
95.
What is the difference between characters \034 and \x34?
96.
How can we pass the variable through the navigation between the pages?
97.
Is it possible to extend the execution time of a php script?
98.
Is it possible to destroy a cookie?
99.
What is the default session time in php?
100.
Is it possible to use COM component in PHP?