Quick Answer
PSR-4 is a standard that maps PHP namespaces to file system directories. Namespace prefix App maps to src/ directory, so App\Models\User loads from src/Models/User.php. Composer implements PSR-4 autoloading automatically based on composer.json configuration. This replaces manual require statements. PSR-4 makes project structure predictable and autoloading efficient.
Answer
PSR-4 maps namespaces to folders. Composer autoloading eliminates manual include calls and keeps code organized.
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.