@@ -407,7 +407,12 @@ static void dd_log_probe_ensure_payload(dd_log_probe_dyn *dyn, dd_log_probe_def
407407
408408static void dd_log_probe_capture_snapshot (ddog_DebuggerCapture * capture , dd_log_probe_def * def , zend_execute_data * execute_data ) {
409409 const ddog_CaptureConfiguration * capture_config = def -> parent .probe .probe .log .capture ;
410- if (ZEND_USER_CODE (EX (func )-> type )) {
410+ #if PHP_VERSION_ID < 80600
411+ if (ZEND_USER_CODE (EX (func )-> type ))
412+ #else
413+ if (ZEND_USER_CODE (EX (func )-> type ) || EX (func )-> internal_function .arg_info )
414+ #endif
415+ {
411416 zend_array * symbol_table = zend_rebuild_symbol_table ();
412417 zend_string * symbol ;
413418 zval * variable ;
@@ -421,6 +426,7 @@ static void dd_log_probe_capture_snapshot(ddog_DebuggerCapture *capture, dd_log_
421426 ddog_snapshot_add_field (capture , type , name_slice , capture_value );
422427 }
423428 } ZEND_HASH_FOREACH_END ();
429+ #if PHP_VERSION_ID < 80600
424430 } else if (EX (func )-> internal_function .arg_info ) {
425431 uint32_t num_args = EX (func )-> internal_function .num_args ;
426432 for (uintptr_t i = 0 ; i < num_args ; ++ i ) {
@@ -431,6 +437,7 @@ static void dd_log_probe_capture_snapshot(ddog_DebuggerCapture *capture, dd_log_
431437 ddtrace_create_capture_value (EX_VAR_NUM (i ), & capture_value , capture_config , capture_config -> max_reference_depth );
432438 ddog_snapshot_add_field (capture , DDOG_FIELD_TYPE_ARG , name_slice , capture_value );
433439 }
440+ #endif
434441 }
435442 if (hasThis ()) {
436443 struct ddog_CaptureValue capture_value = {0 };
@@ -977,7 +984,18 @@ static const void *dd_eval_fetch_identifier(void *ctx, const ddog_CharSlice *nam
977984 zend_execute_data * execute_data = eval_ctx -> frame ;
978985
979986 if (EX (func )) {
980- if (ZEND_USER_CODE (EX (func )-> type )) {
987+ #if PHP_VERSION_ID < 80600
988+ if (!ZEND_USER_CODE (EX (func )-> type )) {
989+ int call_args = MIN (EX_NUM_ARGS (), EX (func )-> common .num_args );
990+ for (int i = 0 ; i < call_args ; ++ i ) {
991+ const char * argname = EX (func )-> internal_function .arg_info [i ].name ;
992+ if (zend_binary_strcmp (argname , strlen (argname ), name -> ptr , name -> len ) == 0 ) {
993+ return EX_VAR_NUM (i );
994+ }
995+ }
996+ } else
997+ #endif
998+ {
981999 zend_execute_data * current_execute_data = EG (current_execute_data );
9821000 EG (current_execute_data ) = execute_data ;
9831001 zend_array * symtable = zend_rebuild_symbol_table ();
@@ -989,14 +1007,6 @@ static const void *dd_eval_fetch_identifier(void *ctx, const ddog_CharSlice *nam
9891007 if (zvp ) {
9901008 return zvp ;
9911009 }
992- } else {
993- int call_args = MIN (EX_NUM_ARGS (), EX (func )-> common .num_args );
994- for (int i = 0 ; i < call_args ; ++ i ) {
995- const char * argname = EX (func )-> internal_function .arg_info [i ].name ;
996- if (zend_binary_strcmp (argname , strlen (argname ), name -> ptr , name -> len ) == 0 ) {
997- return EX_VAR_NUM (i );
998- }
999- }
10001010 }
10011011 }
10021012
0 commit comments