1.
PHP Fundamentals
- 2.
How do you execute a PHP script from the command line?
- 3.
Can you describe the differences between PHP 5 and PHP 7/8?
- 4.
What are the common ways to embed PHP into HTML?
- 5.
How would you create a PHP variable and how are they scoped (global, local, static)?
- 6.
Explain the data types that are supported in PHP.
- 7.
How does PHP handle error reporting?
- 8.
What is the purpose of php.ini file?
- 9.
How do you define a constant in PHP?
- 10.
Can you describe the lifecycle of a PHP request?
- 11.
Explain the use of sessions in PHP.
- 12.
How does PHP support cookies?
- 13.
Describe the _$_GET, _$POST, and _$REQUEST superglobal arrays.
- 14.
How can you prevent form submission data from being injected with malicious code?
- 15.
What is the significance of “htmlspecialchars” and “strip_tags” in PHP?
PHP Advanced Features
- 16.
Explain late static binding in PHP.
- 17.
What is a namespace in PHP and why are they used?
- 18.
Can you describe what a closure is in PHP and provide an example?
- 19.
Explain the concept of traits in PHP and how they’re used.
- 20.
How does PHP handle exceptions and error handling?
- 21.
Discuss type declarations and return type in PHP 7/8.
- 22.
What is a generator in PHP and when would you use one?
- 23.
What are anonymous classes and how do you use them in PHP 7/8?
- 24.
Explain how to use the “yield” keyword in PHP.
- 25.
Describe the difference between “include”, “include_once”, “require”, and “require_once”.
PHP Functions and Classes
- 26.
How do you declare a function in PHP?
- 27.
What are magic methods in PHP?
- 28.
How are objects passed in PHP - by value or by reference?
- 29.
What are interfaces and how are they different from abstract classes in PHP?
- 30.
Explain how you can prevent the class from being inherited.
- 31.
What are getters and setters, and why would you use them?
- 32.
Describe method overloading in PHP.
- 33.
How would you use a static method or property in a class?
- 34.
What is the purpose of the “final” keyword in PHP?
- 35.
Discuss dependency injection in PHP.
PHP Database Interaction
- 36.
How does PHP interact with databases?
- 37.
What is PDO (PHP Data Objects) and how it is different from MySQLi?
- 38.
Explain a prepared statement and why it’s used in PHP.
- 39.
How can you perform a transaction with PDO?
- 40.
Describe the process of connecting to a MySQL database using PDO.
- 41.
What mechanisms does PHP provide for accessing NoSQL databases?
- 42.
How would you handle database errors in PHP?
- 43.
Can you explain how ORM tools like Laravel’s Eloquent or Doctrine work in PHP?
- 44.
How does PHP handle database connection persistence?
- 45.
Explain how you would use PHP to handle multiple database connections.
PHP Security Practices
- 46.
What is SQL Injection and how can it be prevented in PHP?
- 47.
How does PHP handle password hashing?
- 48.
Explain Cross-Site Scripting (XSS) and how to prevent it with PHP.
- 49.
Discuss prevention of CSRF (Cross-Site Request Forgery) in PHP.
- 50.
Describe the concept of session hijacking and how PHP can safeguard against it.
- 51.
How would you secure file uploads in PHP?
- 52.
What are the best practices for securing PHP applications on shared hosts?
- 53.
Explain how to securely store sensitive data, such as API keys, in PHP applications.
- 54.
Discuss the use of HTTPS and how PHP can enforce secure connections.
- 55.
What are PHP filters and how can they be used to validate and sanitize data?
PHP Performance Optimization
- 56.
How can you improve the performance of a PHP application?
- 57.
What is opcode caching and how can it be used in PHP?
- 58.
Discuss the use of content delivery networks (CDNs) in relation to PHP applications.
- 59.
How does session storage affect PHP performance and what alternatives exist?
- 60.
Explain how to profile a PHP application for performance issues.
- 61.
What is lazy loading and how can it be implemented in PHP?
- 62.
Discuss the use of indexes in databases and how it relates to PHP performance.
- 63.
How can PHP leverage browser caching?
- 64.
What are some common PHP bottlenecks and how do you resolve them?
- 65.
Describe the concept of connection pooling and its relevance to PHP applications.
PHP Testing and Debugging
- 66.
What tools can you use for unit testing in PHP?
- 67.
How do you debug PHP scripts?
- 68.
What is the purpose of the Xdebug extension for PHP?
- 69.
Discuss the benefits and methods of integration testing in PHP applications.
- 70.
How would you set up a staging environment for testing PHP applications?
- 71.
Describe how assertions can be used in PHP.
- 72.
What is code coverage and how can it be measured in PHP?
- 73.
Discuss the role of continuous integration in PHP development workflows.
- 74.
Explain the “var_dump” and “print_r” methods used in debugging PHP code.
- 75.
How can you track down and fix memory s in PHP?
PHP Configuration and Deployment
- 76.
What is the typical workflow for deploying a PHP application?
- 77.
How does PHP handle file uploads and server file management?
- 78.
Discuss the various ways you can configure PHP logging.
- 79.
What are environment variables in PHP and how can they be used?
- 80.
How would you automate the deployment of a PHP application?
- 81.
Explain the role of Composer in PHP development.
- 82.
Describe a virtual host and how it is configured for PHP applications.
- 83.
How can containerization be utilized in PHP application deployments?
- 84.
Discuss .htaccess files and their importance in PHP configurations.
- 85.
What measures do you take to ensure a smooth rollout of new PHP code in production environments?
PHP Modern Development Practices
- 86.
How has PHP integrated with front-end JavaScript frameworks?
- 87.
Discuss PHP’s support for HTTP/2.
- 88.
Explain the use of WebSockets in PHP.
- 89.
Describe the role of PHP in a microservices architecture.
- 90.
How does PHP handle REST API development?
- 91.
Discuss the use of GraphQL with PHP.
- 92.
What is serverless architecture and can PHP be used in such an environment?
- 93.
How do modern PHP frameworks handle route-based actions?
- 94.
Explain how MVC architecture is implemented in PHP.
- 95.
Describe how PHP can be used for command-line scripting.
PHP Frameworks
- 96.
What are the benefits of using a PHP framework?
- 97.
Can you compare Laravel and Symfony?
- 98.
How would you choose between different PHP frameworks for a project?
- 99.
Discuss the role of template engines in PHP frameworks.
- 100.
Explain the event-driven architecture in PHP frameworks like Laravel.