Skip to content

gurpreetkaits/php-interview-question

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 

Repository files navigation

  • Q1] What is the use of ini_set()?
  • Q2] What is the difference between == and ===?
  • Q3] What is the return type of a function that doesn't return anything?
  • Q4] What does $GLOBALS mean?
  • Q5] What are the keys & values in an indexed array?
  • Q6] What is the purpose of php.ini file?
  • Q7] How can you pass a variable by reference?
  • Q8] Is multiple inheritance supported in PHP?
  • Q9] What is stdClass in PHP?
  • Q10] In PHP, objects are they passed by value or by reference?
  • Q11] What is PDO in PHP?
  • Q12] Is there a difference between isset and !empty?
  • Q13] Differentiate between echo and print()
  • Q14] What is the differences between $a != $b and $a !== $b?
  • Q15] What does the 'var' keyword mean in PHP?
  • Q16] What do we mean by keys and values?
  • Q17] What are the differences between die() and exit() functions in PHP?
  • Q18] Explain what the different PHP errors are
  • Q19] Explain usage of enumerations in PHP
  • Q20] Explain how we handle exceptions in PHP?
  • Q21] What are the main differences between const vs define
  • Q22] What's the difference between isset() and array_key_exists()?
  • Q23] Can you extend a Final defined class?
  • Q24] What are PSRs? Choose 1 and briefly describe it.
  • Q25] How can you enable error reporting in PHP?
  • Q26] When should I use require vs include?
  • Q27] What are the different scopes of variables?
  • Q28] What is the difference between var_dump() and print_r()?
  • Q29] What is the difference between single-quoted and double-quoted strings in PHP?
  • Q30] How is it possible to set an infinite execution time for PHP script?
  • Q31] Give me some real life examples when you had to use __destruct in your classes
  • Q32] Is there a function to make a copy of a PHP array to another?
  • Q33] Explain the difference between exec() vs system() vs passthru()?
  • Q34] Are Parent constructors called implicitly inside a class constructor?
  • Q35] Maximum how many arguments are allowed in a function in PHP?
  • Q36] What is the difference between PDO's query() vs execute()?
  • Q37] Explain the difference between shell_exec() and exec()
  • Q38] What is the difference between a PHP interpreter and a PHP handler?
  • Q39] Differentiate between exception and error
  • Q40] What exactly is the the difference between array_map, array_walk and array_filter?
  • Q41] What are the exception class functions?
  • Q42] What are some of the big changes PHP has gone through in the past few years?
  • Q43] Differentiate between parameterised and non parameterised functions
  • Q44] Why do we use extract()?
  • Q45] Explain function call by reference
  • Q46] What is the difference between using self and $this?
  • Q47] What is use of Null Coalesce Operator?
  • Q48] Does PHP support method overloading?
  • Q49] What is the difference between MySQL, MySQLi and PDO?
  • Q50] What is autoloading classes in PHP?
  • Q51] When should I use require_once vs require?
  • Q52] Is there any reason to use strcmp() for strings comparison?
  • Q53] Compare MySQLi or PDO - what are the pros and cons?
  • Q54] Store an array as JSON or as a PHP serialized array?
  • Q55] What are the disadvantages of using persistent connection in PDO?
  • Q56] What exactly are late static bindings in PHP?
  • Q57] Explain the Exception Hierarchy introduced in PHP7
  • Q58] Explain what is a closure in PHP and why does it use the “use” identifier?
  • Q59] What is use of Spaceship Operator?
  • Q60] What is the best method to merge two PHP objects?
  • Q61] Is PHP single or multi threaded?
  • Q62] How to turn errors into exceptions in PHP?
  • Q63] What does $$ mean?
  • Q64] What is the crucial difference between using traits versus interfaces?
  • Q65] What does yield mean in PHP?
  • Q66] What's better at freeing memory with PHP: unset() or $var = null?
  • Q67] Does PHP have threading?
  • Q68] Are PDO prepared statements sufficient to prevent SQL injection?
  • Q69] Explain the Order of Precedence for Traits in PHP
  • Q70] What does a $$$ mean in PHP?
  • Q71] What is the difference between a trait and an interface?
  • Q72] What is the difference between a trait and an abstract class?
  • Q73] What is the difference between a trait and a class?
  • Q74] What is the difference between a trait and a normal class?

Code Challenges

  • Q1] Declare some function with default parameter
  • Q2] PHP array delete by value (not key)
  • Q3] What will be returned by this code? Explain the result.
  • Q4] How do I pass variables and data from PHP to JavaScript?
  • Q5] Let's create Enumerations for PHP. Prove some code examples.
  • Q6] How would you create a Singleton class using PHP?
  • Q7] What does the following code output?
  • Q8] What will be returned by this code?
  • Q9] Check if PHP array is associative
  • Q10] How to measure execution times of PHP scripts?
  • Q11] How could we implement method overloading in PHP?
  • Q12] Provide some ways to mimic multiple constructors in PHP

PHP Interview Question (Urls)

About

PHP interiew questions for everyone.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published