Skip to content

Commit 27ce269

Browse files
committed
Revert "Fix bug #24214 implement access to skip_last in user API for backtrace"
This reverts commit a5cef84.
1 parent d4b843b commit 27ce269

6 files changed

+9
-89
lines changed

NEWS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ PHP NEWS
1313
(Björn Tantau)
1414
. Fixed bug #81076 (incorrect debug info on Closures with implicit binds).
1515
(krakjoe)
16-
. Fixed bug #24214 (implement skipping frames in backtraces). (krakjoe)
1716

1817
- Standard:
1918
. Fixed bug #77627 (method_exists on Closure::__invoke inconsistency).

Zend/tests/debug_backtrace_skip_last.phpt

Lines changed: 0 additions & 40 deletions
This file was deleted.

Zend/tests/debug_print_backtrace_skip_last.phpt

Lines changed: 0 additions & 32 deletions
This file was deleted.

Zend/zend_builtin_functions.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1648,14 +1648,13 @@ ZEND_FUNCTION(debug_print_backtrace)
16481648
{
16491649
zend_long options = 0;
16501650
zend_long limit = 0;
1651-
zend_long skip_last = 1;
16521651
zval backtrace;
16531652

1654-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lll", &options, &limit, &skip_last) == FAILURE) {
1653+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ll", &options, &limit) == FAILURE) {
16551654
RETURN_THROWS();
16561655
}
16571656

1658-
zend_fetch_debug_backtrace(&backtrace, skip_last, options, limit);
1657+
zend_fetch_debug_backtrace(&backtrace, 1, options, limit);
16591658
ZEND_ASSERT(Z_TYPE(backtrace) == IS_ARRAY);
16601659

16611660
zend_string *str = zend_trace_to_string(Z_ARRVAL(backtrace), /* include_main */ false);
@@ -1685,11 +1684,8 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
16851684
return;
16861685
}
16871686

1688-
while (skip_last--) {
1689-
if (!call->prev_execute_data) {
1690-
break;
1691-
}
1692-
1687+
if (skip_last) {
1688+
/* skip debug_backtrace() */
16931689
call = call->prev_execute_data;
16941690
}
16951691

@@ -1873,13 +1869,12 @@ ZEND_FUNCTION(debug_backtrace)
18731869
{
18741870
zend_long options = DEBUG_BACKTRACE_PROVIDE_OBJECT;
18751871
zend_long limit = 0;
1876-
zend_long skip_last = 1;
18771872

1878-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lll", &options, &limit, &skip_last) == FAILURE) {
1873+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ll", &options, &limit) == FAILURE) {
18791874
RETURN_THROWS();
18801875
}
18811876

1882-
zend_fetch_debug_backtrace(return_value, skip_last, options, limit);
1877+
zend_fetch_debug_backtrace(return_value, 1, options, limit);
18831878
}
18841879
/* }}} */
18851880

Zend/zend_builtin_functions.stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ function get_loaded_extensions(bool $zend_extensions = false): array {}
111111

112112
function get_defined_constants(bool $categorize = false): array {}
113113

114-
function debug_backtrace(int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT, int $limit = 0, int $skip_last = 1): array {}
114+
function debug_backtrace(int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT, int $limit = 0): array {}
115115

116-
function debug_print_backtrace(int $options = 0, int $limit = 0, int $skip_last = 1): void {}
116+
function debug_print_backtrace(int $options = 0, int $limit = 0): void {}
117117

118118
function extension_loaded(string $extension): bool {}
119119

Zend/zend_builtin_functions_arginfo.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 2db8f4b7a5b005a012e1d9d0d3aa2f26d0cb4f85 */
2+
* Stub hash: c333499e3ea100d976f0fa8bb8800ed21b04f1c6 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_version, 0, 0, IS_STRING, 0)
55
ZEND_END_ARG_INFO()
@@ -183,13 +183,11 @@ ZEND_END_ARG_INFO()
183183
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_debug_backtrace, 0, 0, IS_ARRAY, 0)
184184
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "DEBUG_BACKTRACE_PROVIDE_OBJECT")
185185
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, limit, IS_LONG, 0, "0")
186-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, skip_last, IS_LONG, 0, "1")
187186
ZEND_END_ARG_INFO()
188187

189188
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_debug_print_backtrace, 0, 0, IS_VOID, 0)
190189
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0")
191190
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, limit, IS_LONG, 0, "0")
192-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, skip_last, IS_LONG, 0, "1")
193191
ZEND_END_ARG_INFO()
194192

195193
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_extension_loaded, 0, 1, _IS_BOOL, 0)

0 commit comments

Comments
 (0)