Skip to content

Instantly share code, notes, and snippets.

@krakjoe krakjoe/dfa.diff Secret
Last active Jan 31, 2019

Embed
What would you like to do?
diff --git a/xdebug.c b/xdebug.c
index 7442222f..d937b462 100644
--- a/xdebug.c
+++ b/xdebug.c
@@ -1187,11 +1187,26 @@ static void xdebug_overloaded_functions_restore(TSRMLS_D)
PHP_RINIT_FUNCTION(xdebug)
{
char *idekey;
+ zend_long optimizer;
#if defined(ZTS) && defined(COMPILE_DL_XDEBUG)
ZEND_TSRMLS_CACHE_UPDATE();
#endif
+ if ((optimizer = INI_INT("opcache.optimization_level"))) {
+ zend_string *key = zend_string_init(ZEND_STRL("opcache.optimization_level"), 1);
+ zend_string *value;
+
+ optimizer &= ~(1<<5);
+
+ value = strpprintf(0, "0x%08X", optimizer);
+
+ zend_alter_ini_entry(key, value, ZEND_INI_SYSTEM, ZEND_INI_STAGE_STARTUP);
+
+ zend_string_release(key);
+ zend_string_release(value);
+ }
+
/* Get the ide key for this session */
XG(ide_key) = NULL;
idekey = xdebug_env_key(TSRMLS_C);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.