From 89c77585e743901acfdfab3a8ddb50b186ead635 Mon Sep 17 00:00:00 2001 From: Joe Hoyle Date: Wed, 19 Jul 2023 15:13:50 +0200 Subject: [PATCH] Add helper method for function table --- src/zend/globals.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/zend/globals.rs b/src/zend/globals.rs index c9a7a0d..ac8701a 100644 --- a/src/zend/globals.rs +++ b/src/zend/globals.rs @@ -51,6 +51,16 @@ impl ExecutorGlobals { 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. pub fn constants(&self) -> Option<&ZendHashTable> { unsafe { self.zend_constants.as_ref() }