popLoadedRuntime
Callable
Parameters
id: number
The numeric ID returned by
loadPHPRuntime().__namedParameters: { dangerouslyKeepTheRuntimeInTheMap?: boolean } = {}
optionaldangerouslyKeepTheRuntimeInTheMap: boolean = false
Returns PHPRuntime
The PHP runtime object (an Emscripten module instance).
Retrieves a PHP runtime by its ID and removes it from the internal registry.
When you call
loadPHPRuntime(), it creates an Emscripten-based PHP instance and stores it in a module-level Map keyed by a numeric ID. This function is the only way to retrieve that runtime object so you can actually use it.The "pop" semantic is intentional: retrieving a runtime also removes it from the registry. This prevents memory leaks since the registry would otherwise hold references to every runtime ever created. Once you pop a runtime, you own it and are responsible for its lifecycle.
Typical usage flow:
If no runtime exists with the given ID.