Add helper method for function table

This commit is contained in:
Joe Hoyle 2023-07-19 15:13:50 +02:00
parent 42ef04a8ae
commit 89c77585e7

View File

@ -51,6 +51,16 @@ impl ExecutorGlobals {
unsafe { self.class_table.as_ref() } unsafe { self.class_table.as_ref() }
} }
/// Attempts to retrieve the global functions hash table.
pub fn function_table(&self) -> Option<&ZendHashTable> {
unsafe { self.function_table.as_ref() }
}
/// Attempts to retrieve the global functions hash table as mutable.
pub fn function_table_mut(&self) -> Option<&mut ZendHashTable> {
unsafe { self.function_table.as_mut() }
}
/// Attempts to retrieve the global constants table. /// Attempts to retrieve the global constants table.
pub fn constants(&self) -> Option<&ZendHashTable> { pub fn constants(&self) -> Option<&ZendHashTable> {
unsafe { self.zend_constants.as_ref() } unsafe { self.zend_constants.as_ref() }