Sign in to unlock

Get unlimited access to all questions and answers

checked

Get lifetime access

checked

Track progress

checked

Save time

đź‘‹

Hi! Please sign in to edit.

You will receive an email notification when your contribution is accepted.

The fastest way to prepare
for a tech interview

Check our curated list of full-stack, data structures & software architecture interview questions and answers for developers

* If it's yours original answer, you can add a link to your social media account or personal website.
PHP interview questions

PHP interview questions.

Only challenges
Topic progress: 0%
1.

What is the use of ini_set()?

premium question
completed

Answer:

2.

What is the difference between == and ===?

premium question
completed

Answer:

3.

What is the return type of a function that doesn't return anything?

premium question
completed

Answer:

4.

What does $GLOBALS mean?

premium question
completed

Answer:

5.

What are the keys & values in an indexed array?

premium question
completed

Answer:

6.

What is the purpose of php.ini file?

premium question
completed

Answer:

7.

How can you pass a variable by reference?

premium question
completed

Answer:

8.

Is multiple inheritance supported in PHP?

premium question
completed

Answer:

9.

What is stdClass in PHP?

premium question
completed

Answer:

10.

In PHP, objects are they passed by value or by reference?

premium question
completed

Answer:

11.

What is PDO in PHP?

premium question
completed

Answer:

12.

Is there a difference between isset and !empty?

premium question
completed

Answer:

13.

Differentiate between echo and print()

premium question
completed

Answer:

14.

What is the differences between $a != $b and $a !== $b?

premium question
completed

Answer:

15.

What does the 'var' keyword mean in PHP?

premium question
completed

Answer:

16.

What do we mean by keys and values?

premium question
completed

Answer:

17.

What are the differences between die() and exit() functions in PHP?

premium question
completed

Answer:

18.

Explain what the different PHP errors are

premium question
completed

Answer:

19.

Explain usage of enumerations in PHP

premium question
completed

Answer:

20.

Explain how we handle exceptions in PHP?

premium question
completed

Answer:

21.

What are the main differences between const vs define

premium question
completed

Answer:

22.

What's the difference between isset() and array_key_exists()?

premium question
completed

Answer:

23.

Can you extend a Final defined class?

premium question
completed

Answer:

24.

What are PSRs? Choose 1 and briefly describe it.

premium question
completed

Answer:

25.

How can you enable error reporting in PHP?

premium question
completed

Answer:

26.

When should I use require vs. include?

premium question
completed

Answer:

27.

What are the different scopes of variables?

premium question
completed

Answer:

28.

What is the difference between var_dump() and print_r()?

premium question
completed

Answer:

29.

What is the difference between single-quoted and double-quoted strings in PHP?

premium question
completed

Answer:

30.

How is it possible to set an infinite execution time for PHP script?

premium question
completed

Answer:

31.

Give me some real life examples when you had to use __destruct in your classes

premium question
completed

Answer:

32.

Declare some function with default parameter

premium question
completed

Answer:

33.

PHP array delete by value (not key)

premium question
completed

Answer:

34.

Is there a function to make a copy of a PHP array to another?

premium question
completed

Answer:

35.

Explain the difference between exec() vs system() vs passthru()?

premium question
completed

Answer:

36.

Are Parent constructors called implicitly inside a class constructor?

premium question
completed

Answer:

37.

Maximum how many arguments are allowed in a function in PHP?

premium question
completed

Answer:

38.

What is the difference between PDO's query() vs execute()?

premium question
completed

Answer:

39.

Explain the difference between shell_exec() and exec()

premium question
completed

Answer:

40.

What is the difference between a PHP interpreter and a PHP handler?

premium question
completed

Answer:

41.

Differentiate between exception and error

premium question
completed

Answer:

42.

What exactly is the the difference between array_map, array_walk and array_filter?

premium question
completed

Answer:

43.

What are the exception class functions?

premium question
completed

Answer:

44.

What are some of the big changes PHP has gone through in the past few years?

premium question
completed

Answer:

45.

Differentiate between parameterised and non parameterised functions

premium question
completed

Answer:

46.

Why do we use extract()?

premium question
completed

Answer:

47.

Explain function call by reference

premium question
completed

Answer:

48.

What is the difference between using self and $this?

premium question
completed

Answer:

49.

What is use of Null Coalesce Operator?

premium question
completed

Answer:

50.

Does PHP support method overloading?

premium question
completed

Answer:

51.

What is the difference between MySQL, MySQLi and PDO?

premium question
completed

Answer:

52.

What is autoloading classes in PHP?

premium question
completed

Answer:

53.

When should I use require_once vs. require?

premium question
completed

Answer:

54.

Is there any reason to use strcmp() for strings comparison?

premium question
completed

Answer:

55.

What will be returned by this code? Explain the result.

premium question
completed

Answer:

56.

How do I pass variables and data from PHP to JavaScript?

premium question
completed

Answer:

57.

Let's create Enumerations for PHP. Prove some code examples.

premium question
completed

Answer:

58.

How would you create a Singleton class using PHP?

premium question
completed

Answer:

59.

What does the following code output?

premium question
completed

Answer:

60.

What will be returned by this code?

premium question
completed

Answer:

61.

Check if PHP array is associative

premium question
completed

Answer:

62.

Compare mysqli or PDO - what are the pros and cons?

premium question
completed

Answer:

63.

Store an array as JSON or as a PHP serialized array?

premium question
completed

Answer:

64.

What are the disadvantages of using persistent connection in PDO?

premium question
completed

Answer:

65.

What exactly are late static bindings in PHP?

premium question
completed

Answer:

66.

Explain the Exception Hierarchy introduced in PHP7

premium question
completed

Answer:

67.

explain what is a closure in PHP and why does it use the “use” identifier?

premium question
completed

Answer:

68.

What is use of Spaceship Operator?

premium question
completed

Answer:

69.

What is the best method to merge two PHP objects?

premium question
completed

Answer:

70.

Is PHP single or multi threaded?

premium question
completed

Answer:

71.

How to turn errors into exceptions in PHP?

premium question
completed

Answer:

72.

What does $$ mean?

premium question
completed

Answer:

73.

What is the crucial difference between using traits versus interfaces?

premium question
completed

Answer:

74.

What does yield mean in PHP?

premium question
completed

Answer:

75.

What's better at freeing memory with PHP: unset() or $var = null?

premium question
completed

Answer:

76.

Does PHP have threading?

premium question
completed

Answer:

77.

Are PDO prepared statements sufficient to prevent SQL injection?

premium question
completed

Answer:

78.

Explain the Order of Precedence for Traits in PHP

premium question
completed

Answer:

79.

What does a $$$ mean in PHP?

premium question
completed

Answer:

80.

How to measure execution times of PHP scripts?

premium question
completed

Answer:

81.

How could we implement method overloading in PHP?

premium question
completed

Answer:

82.

Provide some ways to mimic multiple constructors in PHP

premium question
completed

Answer:

Reverse Tech Interview: Questions to Stump an Interviewer

Few people want to get into an uncomfortable environment or an unprofitable company with no prospects. If you’re wondering how to get a real feel for a company during an interview, you’re welcome. I’ll give a list of questions that interviewers don’t usually expect...

How to become a programmer, move to the US, and get a dream job

Are you curious about what you need to do to earn more than $15.000 a month, drive a Tesla, live in sunny California, and work at Google, Apple, Facebook, or Amazon?

11 Reactive Systems interview questions and answers for software engineers . Reactive Systems

Reactive systems are an architectural style that allows multiple individual applications to blend into one unit, reacting to their environment, while staying aware of each other. Here is a list of coding interview questions on Reactive Systems to help you get ready...

34 Microservices interview questions and answers for software engineers

Microservice architecture – a variant of the service-oriented architecture structural style – arranges an application as a collection of loosely coupled services. In a microservices architecture, services are fine-grained and the protocols are lightweight. Here is a list of coding intervie...

. Microservices
7 Layering & Middleware interview questions for developers

Middleware in the context of distributed applications is software that provides services beyond those provided by the operating system to enable the various components of a distributed system to communicate and manage data. Middleware supports and simplifies complex distributed application...

. Layering & Middleware
55 Docker interview questions and answers for software engineers

Docker is a set of platform as a service products that use OS-level virtualization to deliver software in packages called containers. Here is a list of coding interview questions on Docker to help you get ready for your next data structures interview in 2021.

. Docker
23 Databases interview questions and answers for software engineers

A database is an organized collection of data, generally stored and accessed electronically from a computer system. Where databases are more complex they are often developed using formal design and modeling techniques. Here is a list of coding interview questions on Databases to help you g...

. Databases
21 Concurrency interview questions and answers for software engineers

In computer science, concurrency is the ability of different parts or units of a program, algorithm, or problem to be executed out-of-order or in partial order, without affecting the final outcome. Here is a list of coding interview questions on Concurrency to help you get ready for your n...

. Concurrency
13 CAP Theorem interview questions and answers for software engineers

In theoretical computer science, the CAP theorem, also named Brewer's theorem after computer scientist Eric Brewer, states that it is impossible for a distributed data store to simultaneously provide more than two out of the following three guarantees: Consistency: Every read receives the ...

. CAP Theorem
18 Caching interview questions and answers for software engineers

Caching is a technique that stores a copy of a given resource and serves it back when requested. Here is a list of coding interview questions on Caching to help you get ready for your next data structures interview in 2021.

. Caching
Load more posts

Features

folder icon

Access all answers

Get the inside track on what to expect in your next tech interview. We offer you a collection of high quality technical interview questions to help you prepare for your next coding interview.

graph icon

Track progress

A smart interface helps you track your progress and focus on the topics you need. You can search through questions or sort them by difficulty or type.

clock icon

Save time

Save tens of hours searching for information on hundreds of low-quality sites designed to drive traffic and make money from advertising.

Land a six-figure job at one of the top companies.

amazon logo facebook logo google logo microsoft logo uber logo
Prepare for a technical interview

Get hired with our
tech interview questions & answers