diff --git a/phper-doc/doc/_06_module/_02_register_functions/index.md b/phper-doc/doc/_06_module/_02_register_functions/index.md index 138a6ce2..452ff9d6 100644 --- a/phper-doc/doc/_06_module/_02_register_functions/index.md +++ b/phper-doc/doc/_06_module/_02_register_functions/index.md @@ -115,7 +115,7 @@ The output of `php --re` for this function would look like: Function [ function my_function ] { - Parameters [3] { - Parameter #0 [ ?class_name $a_class ] + Parameter #0 [ ?\MyNamespace\MyInterface $a_class ] Parameter #1 [ string $name = 'my_default' ] Parameter #2 [ bool $optional_bool = ] } diff --git a/phper/src/functions.rs b/phper/src/functions.rs index 11809034..d13e1132 100644 --- a/phper/src/functions.rs +++ b/phper/src/functions.rs @@ -670,6 +670,28 @@ impl ZFunc { } } + /// Gets the start line number of the declaration of the currently + /// executing function. + pub fn get_line_start(&self) -> Option { + unsafe { + match u32::from(self.inner.type_) { + ZEND_USER_FUNCTION | ZEND_EVAL_CODE => Some(self.inner.op_array.line_start), + _ => None, + } + } + } + + /// Gets the end line number of the declaration of the currently + /// executing function. + pub fn get_line_end(&self) -> Option { + unsafe { + match u32::from(self.inner.type_) { + ZEND_USER_FUNCTION | ZEND_EVAL_CODE => Some(self.inner.op_array.line_end), + _ => None, + } + } + } + /// Get the function or method fully-qualified name. pub fn get_function_or_method_name(&self) -> ZString { unsafe { diff --git a/phper/src/values.rs b/phper/src/values.rs index f58c0671..cb398196 100644 --- a/phper/src/values.rs +++ b/phper/src/values.rs @@ -133,7 +133,7 @@ impl ExecuteData { /// Gets the current opline line number if available. This represents the /// line number in the source code where the current operation is being /// executed. - pub fn get_lineno(&self) -> Option { + pub fn get_opline_lineno(&self) -> Option { unsafe { match u32::from((*self.inner.func).type_) { ZEND_USER_FUNCTION | ZEND_EVAL_CODE => {