Prepare Interview

Exams Attended

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

PHP Interview Questions and Answers

Test your skills through the online practice test: PHP Quiz Online Practice Test

Intermediate / 1 to 5 years experienced level questions & answers

Ques 1. What's the difference between include and require? -

It's how they handle failures. If the file is not found by require(), it will cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue.

Is it helpful? Add Comment View Comments
 

Ques 2. Will comparison of string "10" and integer 11 work in PHP?

Yes, internally PHP will cast everything to the integer type, so numbers 10 and 11 will be compared.

Is it helpful? Add Comment View Comments
 

Ques 3. Are objects passed by value or by reference?

Everything is passed by value.

Is it helpful? Add Comment View Comments
 

Ques 4. What's the special meaning of __sleep and __wakeup?

__sleep returns the array of all the variables than need to be saved, while __wakeup retrieves them.

Is it helpful? Add Comment View Comments
 

Ques 5. What's the difference between htmlentities() and htmlspecialchars()?

htmlspecialchars only takes care of <, >, single quote ', double quote " and ampersand. htmlentities translates all occurrences of character sequences that have different meaning in HTML.

Is it helpful? Add Comment View Comments
 

Ques 6. How do you match the character ^ at the beginning of the string?

^^

Is it helpful? Add Comment View Comments
 

Most helpful rated by users:

Related differences

PHP vs JSP

Related interview subjects

PHP interview questions and answers - Total 27 questions
jQuery interview questions and answers - Total 22 questions
React interview questions and answers - Total 40 questions
Dojo interview questions and answers - Total 23 questions
Ajax interview questions and answers - Total 58 questions
ASP interview questions and answers - Total 82 questions
Angular interview questions and answers - Total 50 questions
Oracle JET(OJET) interview questions and answers - Total 54 questions
ExtJS interview questions and answers - Total 50 questions
Angular JS interview questions and answers - Total 21 questions
JavaScript interview questions and answers - Total 59 questions
©2023 WithoutBook