A PHP internals pre-RFC discussion proposes 'runtime modules' — request-lifetime named units with their own class/function/constant symbol tables, designed to enable package-level symbol isolation in a way that maps naturally to Composer dependencies. Each Composer package would run in its own module, with symbol identity becoming a (module, symbol_name) tuple. The thread explores design tradeoffs: one respondent prefers calling them 'containers' (analogous to Docker) to emphasize that consuming code, not distributed packages, drives isolation — allowing existing packages to run unchanged. Key open challenges include how objects passed between containers/modules are typed, how instanceof and get_class() behave across boundaries, and how to handle dependency trees with conflicting versions of the same class. The discussion draws parallels to Java's isolated ClassLoader and debates whether symbol tagging by version is sufficient or whether a full dependency fingerprint is needed.

53m read timeFrom externals.io
Post cover image
155 Impressions