1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use crate::bindings::{_zend_executor_globals, ext_php_rs_executor_globals};
use super::types::array::ZendHashTable;
pub type ExecutorGlobals = _zend_executor_globals;
impl ExecutorGlobals {
pub fn get() -> &'static Self {
unsafe { ext_php_rs_executor_globals().as_ref() }
.expect("Static executor globals were invalid")
}
pub fn class_table(&self) -> Option<ZendHashTable> {
if self.class_table.is_null() {
return None;
}
unsafe { ZendHashTable::from_ptr(self.class_table, false) }.ok()
}
}