Skip to content

Commit 5d1ffce

Browse files
authored
Add helper to get global constants (#222)
ExecutorGlobals::constants() will return a hash map of the available constants.
1 parent a9dffe0 commit 5d1ffce

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/zend/globals.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ impl ExecutorGlobals {
5050
unsafe { self.class_table.as_ref() }
5151
}
5252

53+
/// Attempts to retrieve the global constants table.
54+
pub fn constants(&self) -> Option<&ZendHashTable> {
55+
unsafe { self.zend_constants.as_ref() }
56+
}
57+
5358
/// Attempts to extract the last PHP exception captured by the interpreter.
5459
/// Returned inside a [`ZBox`].
5560
///

0 commit comments

Comments
 (0)