Skip to content

Commit

Permalink
Fixed issue #2102: Drop support for PHP 7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
derickr committed Jun 29, 2022
1 parent 7caf91b commit 717fd8b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 35 deletions.
6 changes: 3 additions & 3 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ if test "$PHP_XDEBUG" != "no"; then
AC_MSG_CHECKING([Check for supported PHP versions])
PHP_XDEBUG_FOUND_VERSION=`${PHP_CONFIG} --version`
PHP_XDEBUG_FOUND_VERNUM=`echo "${PHP_XDEBUG_FOUND_VERSION}" | $AWK 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 100 + [$]2) * 100 + [$]3;}'`
if test "$PHP_XDEBUG_FOUND_VERNUM" -lt "70300"; then
AC_MSG_ERROR([not supported. Need a PHP version >= 7.3.0 and < 8.3.0 (found $PHP_XDEBUG_FOUND_VERSION)])
if test "$PHP_XDEBUG_FOUND_VERNUM" -lt "70400"; then
AC_MSG_ERROR([not supported. Need a PHP version >= 7.4.0 and < 8.3.0 (found $PHP_XDEBUG_FOUND_VERSION)])
else
if test "$PHP_XDEBUG_FOUND_VERNUM" -ge "80300"; then
AC_MSG_ERROR([not supported. Need a PHP version >= 7.3.0 and < 8.3.0 (found $PHP_XDEBUG_FOUND_VERSION)])
AC_MSG_ERROR([not supported. Need a PHP version >= 7.4.0 and < 8.3.0 (found $PHP_XDEBUG_FOUND_VERSION)])
else
AC_MSG_RESULT([supported ($PHP_XDEBUG_FOUND_VERSION)])
fi
Expand Down
12 changes: 0 additions & 12 deletions src/gcstats/gc_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,32 +283,20 @@ PHP_FUNCTION(xdebug_stop_gcstats)
Return number of times garbage collection was triggered. */
PHP_FUNCTION(xdebug_get_gc_run_count)
{
#if PHP_VERSION_ID >= 70300
zend_gc_status status;
#endif

#if PHP_VERSION_ID >= 70300
zend_gc_get_status(&status);
RETURN_LONG(status.runs);
#else
RETURN_LONG(GC_G(gc_runs));
#endif
}

/* {{{ proto void xdebug_get_gc_total_collected_roots()
Return total number of collected root variables during garbage collection. */
PHP_FUNCTION(xdebug_get_gc_total_collected_roots)
{
#if PHP_VERSION_ID >= 70300
zend_gc_status status;
#endif

#if PHP_VERSION_ID >= 70300
zend_gc_get_status(&status);
RETURN_LONG(status.collected);
#else
RETURN_LONG(GC_G(collected));
#endif
}

/* {{{ helpers */
Expand Down
14 changes: 1 addition & 13 deletions src/lib/var_export_line.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,28 +199,16 @@ void xdebug_var_export_line(zval **struc, xdebug_str *str, int level, int debug_
} else if ((size_t) Z_STRLEN_P(*struc) <= (size_t) options->max_data) {
zend_string *tmp_zstr;

#if PHP_VERSION_ID >= 70300
tmp_zstr = php_addcslashes(Z_STR_P(*struc), (char*) "'\\\0..\37", 7);
#else
tmp_zstr = php_addcslashes(Z_STR_P(*struc), 0, (char*) "'\\\0..\37", 7);
#endif

xdebug_str_addc(str, '\'');
xdebug_str_add_zstr(str, tmp_zstr);
xdebug_str_addc(str, '\'');

zend_string_release(tmp_zstr);
} else {
#if PHP_VERSION_ID >= 70300
zend_string *tmp_zstr = php_addcslashes_str(ZSTR_VAL(Z_STR_P(*struc)), options->max_data, (char*) "'\\\0..\37", 7);
#else
zend_string *tmp_zstr = NULL;
zend_string *truncated_zstr = zend_string_copy(Z_STR_P(*struc));

truncated_zstr = zend_string_truncate(truncated_zstr, options->max_data, 0);
tmp_zstr = php_addcslashes(truncated_zstr, 0, (char*) "'\\\0..\37", 7);

zend_string_release(truncated_zstr);
#endif
xdebug_str_addc(str, '\'');
xdebug_str_add_zstr(str, tmp_zstr);
xdebug_str_add_literal(str, "\'...");
Expand Down
7 changes: 0 additions & 7 deletions xdebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,13 +619,6 @@ PHP_RINIT_FUNCTION(xdebug)
return SUCCESS;
}

#if PHP_VERSION_ID <= 70301
/* PHP Bug #77287 causes Xdebug to segfault if Opcache has the "compact
* literals" optimisation turned on. So force the optimisation off for PHP
* 7.3.0 and 7.3.1. */
xdebug_disable_opcache_optimizer();
#endif

xdebug_library_rinit();

if (XDEBUG_MODE_IS(XDEBUG_MODE_COVERAGE)) {
Expand Down

0 comments on commit 717fd8b

Please sign in to comment.