File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ use crate::{
66 types:: { ZendClassObject , ZendObject , Zval } ,
77} ;
88
9+ use super :: function:: Function ;
10+
911/// Execute data passed when a function is called from PHP.
1012///
1113/// This generally contains things related to the call, including but not
@@ -194,6 +196,16 @@ impl ExecuteData {
194196 self . This . object_mut ( )
195197 }
196198
199+ /// Attempt to retrieve the function that is being called.
200+ pub fn function ( & self ) -> Option < & Function > {
201+ unsafe { self . func . as_ref ( ) }
202+ }
203+
204+ /// Attempt to retrieve the previous execute data on the call stack.
205+ pub fn previous ( & self ) -> Option < & Self > {
206+ unsafe { self . prev_execute_data . as_ref ( ) }
207+ }
208+
197209 /// Translation of macro `ZEND_CALL_ARG(call, n)`
198210 /// zend_compile.h:578
199211 ///
Original file line number Diff line number Diff line change 22
33use std:: { fmt:: Debug , os:: raw:: c_char, ptr} ;
44
5- use crate :: ffi:: zend_function_entry;
5+ use crate :: {
6+ ffi:: { zend_function, zend_function_entry} ,
7+ flags:: FunctionType ,
8+ } ;
69
710/// A Zend function entry.
811pub type FunctionEntry = zend_function_entry ;
@@ -36,3 +39,11 @@ impl FunctionEntry {
3639 Box :: into_raw ( Box :: new ( self ) )
3740 }
3841}
42+
43+ pub type Function = zend_function ;
44+
45+ impl Function {
46+ pub fn type_ ( & self ) -> FunctionType {
47+ FunctionType :: from ( unsafe { self . type_ } )
48+ }
49+ }
You can’t perform that action at this time.
0 commit comments