PHP 8.x Programming MCQs & Mock Tests
Topic-wise bilingual PHP questions covering Basics, OOP, Modern PHP 8, PDO, Security, and MVC.
Q1 · PHP Basics, Types & OperatorsBeginner
What is the key difference between `switch` and PHP 8.0's `match` expression?
Q2 · PHP Basics, Types & OperatorsBeginner
Which declaration enforces strict scalar type checking for function calls in a PHP file?
Q3 · OOP, Modern PHP 8.x & Type SystemIntermediate
Which PHP keyword resolves to the runtime called class in inheritance hierarchies (Late Static Binding)?
Q4 · OOP, Modern PHP 8.x & Type SystemAdvanced
Which PHP 8.1+ return type indicates a function always throws or terminates and never returns normally?
Q5 · PDO, Security & ArchitectureIntermediate
Which function should be used in modern PHP to securely hash user passwords?
Q6 · PDO, Security & ArchitectureAdvanced
Why is setting `PDO::ATTR_EMULATE_PREPARES => false` recommended for MySQL?