Add helper to get global constants (#222)

ExecutorGlobals::constants() will return a hash map of the available constants.
This commit is contained in:
Joe Hoyle 2023-07-18 22:42:40 +02:00 committed by GitHub
parent a9dffe08f5
commit 5d1ffcec05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,6 +50,11 @@ impl ExecutorGlobals {
unsafe { self.class_table.as_ref() }
}
/// Attempts to retrieve the global constants table.
pub fn constants(&self) -> Option<&ZendHashTable> {
unsafe { self.zend_constants.as_ref() }
}
/// Attempts to extract the last PHP exception captured by the interpreter.
/// Returned inside a [`ZBox`].
///