Quick Answer
PHP data types: Scalar (int, float, string, bool), Compound (array, object), Special (null, resource). PHP is dynamically typed - a variable can change type. PHP 8 added union types (int|string), nullable types (?string), enums, and fibers. Use gettype() to check runtime type. Strong type declaration per file with declare(strict_types=1).
Answer
PHP supports scalars (string, int, float, bool), compound types (array, object), and special types (null, resource).
S
SugharaIQ Editorial Team
Verified Answer
This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.
PHP interview questions and answers for beginner, junior, mid-level, senior, and expert developers. Ideal for freshers and experienced candidates preparing for PHP roles.