Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion phper-doc/doc/_06_module/_02_register_functions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ The output of `php --re` for this function would look like:
Function [ <internal:integration> function my_function ] {

- Parameters [3] {
Parameter #0 [ <required> ?class_name $a_class ]
Parameter #0 [ <required> ?\MyNamespace\MyInterface $a_class ]
Parameter #1 [ <optional> string $name = 'my_default' ]
Parameter #2 [ <optional> bool $optional_bool = <default> ]
}
Expand Down
22 changes: 22 additions & 0 deletions phper/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u32> {
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<u32> {
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 {
Expand Down
2 changes: 1 addition & 1 deletion phper/src/values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u32> {
pub fn get_opline_lineno(&self) -> Option<u32> {
unsafe {
match u32::from((*self.inner.func).type_) {
ZEND_USER_FUNCTION | ZEND_EVAL_CODE => {
Expand Down
Loading