GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — refactor: remove all code for PHP versions lower than 8.2 · php-debugger/php-debugger@4475810

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • base
      • base.c
      • base_globals.h
    • debugger
      • debugger.c
    • lib
      • lib.h
      • str.c
      • usefulstuff.c
      • var.c
      • var_export_html.c
      • var_export_line.c
      • var_export_text.c
      • var_export_xml.c
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/base/base.c‎

Copy file name to clipboardExpand all lines: src/base/base.c
-26Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,13 @@
1919
#include "php_globals.h"
2020
#include "zend_closures.h"
2121
#include "zend_exceptions.h"
22-
#if PHP_VERSION_ID >= 80200
2322
# include "zend_attributes.h"
24-
#endif
2523

2624
#include "zend_interfaces.h"
2725

28-
#if PHP_VERSION_ID >= 80100
2926
# include "base_private.h"
3027
# include "Zend/zend_fibers.h"
3128
# include "Zend/zend_observer.h"
32-
#endif
3329

3430
#include "php_xdebug.h"
3531
#include "php_xdebug_arginfo.h"
@@ -53,15 +49,9 @@ zif_handler orig_pcntl_exec_func = NULL;
5349
zif_handler orig_pcntl_fork_func = NULL;
5450
zif_handler orig_exit_func = NULL;
5551

56-
#if PHP_VERSION_ID >= 80100
5752
void (*xdebug_old_error_cb)(int type, zend_string *error_filename, const uint32_t error_lineno, zend_string *message);
5853
void (*xdebug_new_error_cb)(int type, zend_string *error_filename, const uint32_t error_lineno, zend_string *message);
5954
static void xdebug_error_cb(int orig_type, zend_string *error_filename, const uint32_t error_lineno, zend_string *message);
60-
#else
61-
void (*xdebug_old_error_cb)(int type, const char *error_filename, const uint32_t error_lineno, zend_string *message);
62-
void (*xdebug_new_error_cb)(int type, const char *error_filename, const uint32_t error_lineno, zend_string *message);
63-
static void xdebug_error_cb(int orig_type, const char *error_filename, const uint32_t error_lineno, zend_string *message);
64-
#endif
6555

6656
/* execution redirection functions */
6757
zend_op_array* (*old_compile_file)(zend_file_handle* file_handle, int type);
@@ -1023,7 +1013,6 @@ void xdebug_base_rshutdown(void)
10231013
}
10241014

10251015
/* Error callback for formatting stack traces */
1026-
#if PHP_VERSION_ID >= 80100
10271016
static void xdebug_error_cb(int orig_type, zend_string *error_filename, const unsigned int error_lineno, zend_string *message)
10281017
{
10291018
int type = orig_type & E_ALL;
@@ -1035,19 +1024,6 @@ static void xdebug_error_cb(int orig_type, zend_string *error_filename, const un
10351024

10361025
xdebug_old_error_cb(orig_type, error_filename, error_lineno, message);
10371026
}
1038-
#else
1039-
static void xdebug_error_cb(int orig_type, const char *error_filename, const unsigned int error_lineno, zend_string *message)
1040-
{
1041-
int type = orig_type & E_ALL;
1042-
char *error_type_str = xdebug_error_type(type);
1043-
zend_string *tmp_error_filename = zend_string_init(error_filename, strlen(error_filename), 0);
1044-
1045-
xdebug_debugger_error_cb(tmp_error_filename, error_lineno, type, error_type_str, ZSTR_VAL(message));
1046-
1047-
zend_string_release(tmp_error_filename);
1048-
xdfree(error_type_str);
1049-
}
1050-
#endif
10511027

10521028
void xdebug_base_use_original_error_cb(void)
10531029
{
@@ -1074,11 +1050,9 @@ static void xdebug_throw_exception_hook(zend_object *exception)
10741050
return;
10751051
}
10761052

1077-
#if PHP_VERSION_ID >= 80100
10781053
if (zend_is_graceful_exit(exception)) {
10791054
return;
10801055
}
1081-
#endif
10821056

10831057
exception_ce = exception->ce;
10841058

Collapse file

‎src/base/base_globals.h‎

Copy file name to clipboardExpand all lines: src/base/base_globals.h
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ typedef struct _xdebug_nanotime_context {
4141

4242
typedef struct _xdebug_base_globals_t {
4343
xdebug_vector *stack;
44-
#if PHP_VERSION_ID >= 80100
4544
xdebug_hash *fiber_stacks;
46-
#endif
4745
xdebug_nanotime_context nanotime_context;
4846
uint64_t start_nanotime;
4947
unsigned int working_tsc_clock; /* -1 = unknown, 0 = not available, 1 = available */
Collapse file

‎src/debugger/debugger.c‎

Copy file name to clipboardExpand all lines: src/debugger/debugger.c
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,15 +1041,13 @@ static void add_function_to_lines_list(xdebug_lines_list *lines_list, zend_op_ar
10411041
lines_list->functions[lines_list->count] = map_item;
10421042
lines_list->count++;
10431043

1044-
#if PHP_VERSION_ID >= 80100
10451044
if (opa->num_dynamic_func_defs) {
10461045
uint32_t i;
10471046

10481047
for (i = 0; i < opa->num_dynamic_func_defs; i++) {
10491048
add_function_to_lines_list(lines_list, opa->dynamic_func_defs[i]);
10501049
}
10511050
}
1052-
#endif
10531051
}
10541052
/* }}} */
10551053

Collapse file

‎src/lib/lib.h‎

Copy file name to clipboardExpand all lines: src/lib/lib.h
+1-7Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ typedef struct xdebug_var_name {
4848
#define XFUNC_REQUIRE 0x13
4949
#define XFUNC_REQUIRE_ONCE 0x14
5050
#define XFUNC_MAIN 0x15
51-
#if PHP_VERSION_ID >= 80100
52-
# define XFUNC_FIBER 0x16
53-
#endif
51+
#define XFUNC_FIBER 0x16
5452

5553
#define XFUNC_ZEND_PASS 0x20
5654

@@ -140,11 +138,7 @@ typedef struct _function_stack_entry {
140138

141139
/* misc properties */
142140
zend_op_array *op_array;
143-
#if PHP_VERSION_ID >= 80100
144141
void (*soap_error_cb)(int type, zend_string *error_filename, const uint32_t error_lineno, zend_string *message);
145-
#else
146-
void (*soap_error_cb)(int type, const char *error_filename, const uint32_t error_lineno, zend_string *message);
147-
#endif
148142
} function_stack_entry;
149143

150144
function_stack_entry *xdebug_get_stack_frame(int nr);
Collapse file

‎src/lib/str.c‎

Copy file name to clipboardExpand all lines: src/lib/str.c
-17Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ void xdebug_str_add_uint64(xdebug_str *xs, uint64_t num)
114114
xdebug_str_internal_addl(xs, pos, &buffer[20] - pos, 0);
115115
}
116116

117-
#if PHP_VERSION_ID >= 80200
118117
void xdebug_str_add_va_fmt(xdebug_str *xs, const char *fmt, va_list argv)
119118
{
120119
int size;
@@ -146,22 +145,6 @@ void xdebug_str_add_va_fmt(xdebug_str *xs, const char *fmt, va_list argv)
146145

147146
assert(0);
148147
}
149-
#else
150-
void xdebug_str_add_va_fmt(xdebug_str *xs, const char *fmt, va_list argv)
151-
{
152-
smart_str buf = {0};
153-
154-
php_printf_to_smart_str(&buf, fmt, argv);
155-
156-
if (!buf.s) {
157-
return;
158-
}
159-
160-
xdebug_str_add_zstr(xs, buf.s);
161-
162-
smart_str_free(&buf);
163-
}
164-
#endif
165148

166149
void xdebug_str_add_fmt(xdebug_str *xs, const char *fmt, ...)
167150
{
Collapse file

‎src/lib/usefulstuff.c‎

Copy file name to clipboardExpand all lines: src/lib/usefulstuff.c
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,7 @@
4141
#include "usefulstuff.h"
4242
#include "log.h"
4343

44-
#if PHP_VERSION_ID >= 80200
4544
# include "ext/random/php_random.h"
46-
#else
47-
# include "ext/standard/php_lcg.h"
48-
#endif
4945
#include "ext/standard/flock_compat.h"
5046
#include "main/php_ini.h"
5147

Collapse file

‎src/lib/var.c‎

Copy file name to clipboardExpand all lines: src/lib/var.c
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -916,11 +916,9 @@ xdebug_str* xdebug_get_property_type(zval* object, zval *val)
916916
zend_string *type_info = zend_type_to_string(info->type);
917917
type_str = xdebug_str_new();
918918

919-
# if PHP_VERSION_ID >= 80100
920919
if (info->flags & ZEND_ACC_READONLY) {
921920
xdebug_str_add_literal(type_str, "readonly ");
922921
}
923-
# endif
924922

925923
xdebug_str_add_zstr(type_str, type_info);
926924
zend_string_release(type_info);
@@ -1212,11 +1210,9 @@ char* xdebug_show_fname(xdebug_func f, int flags)
12121210
return xdstrdup("{zend_pass}");
12131211
break;
12141212

1215-
#if PHP_VERSION_ID >= 80100
12161213
case XFUNC_FIBER:
12171214
return xdebug_sprintf("%s", ZSTR_VAL(f.function));
12181215
break;
1219-
#endif
12201216

12211217
default:
12221218
return xdstrdup("{unknown}");
Collapse file

‎src/lib/var_export_html.c‎

Copy file name to clipboardExpand all lines: src/lib/var_export_html.c
+7-13Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,13 @@
1717
#include "var_export_html.h"
1818
#include "lib_private.h"
1919
#include "Zend/zend_closures.h"
20-
#if PHP_VERSION_ID >= 80100
21-
# if !defined(_MSC_VER)
22-
# pragma GCC diagnostic push
23-
# pragma GCC diagnostic ignored "-Wdeclaration-after-statement"
24-
# endif
25-
# include "zend_enum.h"
26-
# if !defined(_MSC_VER)
27-
# pragma GCC diagnostic pop
28-
# endif
20+
#if !defined(_MSC_VER)
21+
# pragma GCC diagnostic push
22+
# pragma GCC diagnostic ignored "-Wdeclaration-after-statement"
23+
#endif
24+
#include "zend_enum.h"
25+
#if !defined(_MSC_VER)
26+
# pragma GCC diagnostic pop
2927
#endif
3028

3129
ZEND_EXTERN_MODULE_GLOBALS(xdebug)
@@ -245,7 +243,6 @@ void xdebug_var_export_html(zval **struc, xdebug_str *str, int level, int debug_
245243
break;
246244

247245
case IS_OBJECT: {
248-
#if PHP_VERSION_ID >= 80100
249246
zend_class_entry *ce = Z_OBJCE_P(*struc);
250247
if (ce->ce_flags & ZEND_ACC_ENUM) {
251248
zval *case_name_zval = zend_enum_fetch_case_name(Z_OBJ_P(*struc));
@@ -274,7 +271,6 @@ void xdebug_var_export_html(zval **struc, xdebug_str *str, int level, int debug_
274271
xdebug_str_addc(str, '\n');
275272
break;
276273
}
277-
#endif
278274

279275
myht = xdebug_objdebug_pp(struc, XDEBUG_VAR_OBJDEBUG_USE_DEBUGINFO);
280276
xdebug_str_add_fmt(str, "\n%*s", (level - 1) * 4, "");
@@ -418,14 +414,12 @@ static void xdebug_var_synopsis_html(zval **struc, xdebug_str *str, int level, i
418414
break;
419415

420416
case IS_OBJECT: {
421-
#if PHP_VERSION_ID >= 80100
422417
zend_class_entry *ce = Z_OBJCE_P(*struc);
423418
if (ce->ce_flags & ZEND_ACC_ENUM) {
424419
zval *case_name_zval = zend_enum_fetch_case_name(Z_OBJ_P(*struc));
425420
xdebug_str_add_fmt( str, "<font color='%s'>enum(%s::%s)</font>", COLOR_OBJECT, ZSTR_VAL(ce->name), Z_STRVAL_P(case_name_zval));
426421
break;
427422
}
428-
#endif
429423

430424
xdebug_str_add_fmt(str, "<font color='%s'>object(%s)[%d]</font>", COLOR_OBJECT, ZSTR_VAL(Z_OBJCE_P(*struc)->name), Z_OBJ_HANDLE_P(*struc));
431425
} break;
Collapse file

‎src/lib/var_export_line.c‎

Copy file name to clipboardExpand all lines: src/lib/var_export_line.c
+7-44Lines changed: 7 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,13 @@
1717
#include "lib/php-header.h"
1818
#include "ext/standard/php_string.h"
1919
#include "Zend/zend_closures.h"
20-
#if PHP_VERSION_ID >= 80100
21-
# if !defined(_MSC_VER)
22-
# pragma GCC diagnostic push
23-
# pragma GCC diagnostic ignored "-Wdeclaration-after-statement"
24-
# endif
25-
# include "zend_enum.h"
26-
# if !defined(_MSC_VER)
27-
# pragma GCC diagnostic pop
28-
# endif
20+
#if !defined(_MSC_VER)
21+
# pragma GCC diagnostic push
22+
# pragma GCC diagnostic ignored "-Wdeclaration-after-statement"
23+
#endif
24+
#include "zend_enum.h"
25+
#if !defined(_MSC_VER)
26+
# pragma GCC diagnostic pop
2927
#endif
3028

3129
#include "var_export_line.h"
@@ -112,33 +110,6 @@ static int xdebug_object_element_export(zval *object, zval *zv_nptr, zend_ulong
112110
return 0;
113111
}
114112

115-
#if PHP_VERSION_ID < 80200
116-
static void handle_closure(xdebug_str *str, zval *obj)
117-
{
118-
const zend_function *closure_function;
119-
120-
if (Z_TYPE_P(obj) != IS_OBJECT || !instanceof_function(Z_OBJCE_P(obj), zend_ce_closure)) {
121-
return;
122-
}
123-
124-
closure_function = zend_get_closure_method_def(Z_OBJ_P(obj));
125-
126-
xdebug_str_add_literal(str, "virtual $closure = \"");
127-
128-
if (closure_function->common.scope) {
129-
if (closure_function->common.fn_flags & ZEND_ACC_STATIC) {
130-
xdebug_str_add(str, ZSTR_VAL(closure_function->common.scope->name), 0);
131-
xdebug_str_add_literal(str, "::");
132-
} else {
133-
xdebug_str_add_literal(str, "$this->");
134-
}
135-
}
136-
xdebug_str_add_zstr(str, closure_function->common.function_name);
137-
138-
xdebug_str_add_literal(str, "\", ");
139-
}
140-
#endif
141-
142113
void xdebug_var_export_line(zval **struc, xdebug_str *str, int level, int debug_zval, xdebug_var_export_options *options)
143114
{
144115
HashTable *myht;
@@ -249,9 +220,7 @@ void xdebug_var_export_line(zval **struc, xdebug_str *str, int level, int debug_
249220
break;
250221

251222
case IS_OBJECT: {
252-
#if PHP_VERSION_ID >= 80100
253223
zend_class_entry *ce = Z_OBJCE_P(*struc);
254-
#endif
255224

256225
#if PHP_VERSION_ID >= 80400
257226
if (
@@ -267,7 +236,6 @@ void xdebug_var_export_line(zval **struc, xdebug_str *str, int level, int debug_
267236
}
268237
#endif
269238

270-
#if PHP_VERSION_ID >= 80100
271239
if (ce->ce_flags & ZEND_ACC_ENUM) {
272240
zval *case_name_zval = zend_enum_fetch_case_name(Z_OBJ_P(*struc));
273241
xdebug_str_add_fmt(str, "enum %s::%s", ZSTR_VAL(ce->name), Z_STRVAL_P(case_name_zval));
@@ -292,7 +260,6 @@ void xdebug_var_export_line(zval **struc, xdebug_str *str, int level, int debug_
292260

293261
break;
294262
}
295-
#endif
296263

297264
myht = xdebug_objdebug_pp(struc, XDEBUG_VAR_OBJDEBUG_USE_DEBUGINFO);
298265

@@ -301,10 +268,6 @@ void xdebug_var_export_line(zval **struc, xdebug_str *str, int level, int debug_
301268
xdebug_str_add(str, ZSTR_VAL(Z_OBJCE_P(*struc)->name), 0);
302269
xdebug_str_add_literal(str, " { ");
303270

304-
#if PHP_VERSION_ID < 80200
305-
handle_closure(str, *struc);
306-
#endif
307-
308271
if (myht && (level <= options->max_depth)) {
309272
options->runtime[level].current_element_nr = 0;
310273
options->runtime[level].start_element_nr = 0;

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.