Type Definition ext_php_rs::zend::ExecutorGlobals

source ·
pub type ExecutorGlobals = _zend_executor_globals;
Expand description

Stores global variables used in the PHP executor.

Implementations§

source§

impl ExecutorGlobals

source

pub fn get() -> GlobalReadGuard<Self>

Returns a reference to the PHP executor globals.

The executor globals are guarded by a RwLock. There can be multiple immutable references at one time but only ever one mutable reference. Attempting to retrieve the globals while already holding the global guard will lead to a deadlock. Dropping the globals guard will release the lock.

source

pub fn get_mut() -> GlobalWriteGuard<Self>

Returns a mutable reference to the PHP executor globals.

The executor globals are guarded by a RwLock. There can be multiple immutable references at one time but only ever one mutable reference. Attempting to retrieve the globals while already holding the global guard will lead to a deadlock. Dropping the globals guard will release the lock.

source

pub fn class_table(&self) -> Option<&ZendHashTable>

Attempts to retrieve the global class hash table.

source

pub fn take_exception() -> Option<ZBox<ZendObject>>

Attempts to extract the last PHP exception captured by the interpreter. Returned inside a ZBox.

This function requires the executor globals to be mutably held, which could lead to a deadlock if the globals are already borrowed immutably or mutably.