Skip to main content
InterviewHubPRO
Section Overview
Q19

Question 19 of 50

Part 2: Zend Engine Internals, OPcache & Memory Architecture (11 - 24)

38%
PHP & Zend Engine (50 Qs)•Part 2: Zend Engine Internals, OPcache & Memory Architecture (11 - 24)

How does Composer Autoloading and PSR-4 work under the hood?

senior LevelMost AskedDocker & ContainersSystem Design

In Simple Words: PSR-4 maps namespace prefixes to relative directory paths. Composer generates an internal class map file (vendor/composer/autoload_classmap.php). In production, running composer dump-autoload -o creates an authoritative $O(1)$ array lookup, eliminating filesystem lookups entirely.