@@ -408,7 +408,12 @@ static void dd_log_probe_ensure_payload(dd_log_probe_dyn *dyn, dd_log_probe_def
408408
409409static void dd_log_probe_capture_snapshot (ddog_DebuggerCapture * capture , dd_log_probe_def * def , zend_execute_data * execute_data ) {
410410 const ddog_CaptureConfiguration * capture_config = def -> parent .probe .probe .log .capture ;
411- if (ZEND_USER_CODE (EX (func )-> type )) {
411+ #if PHP_VERSION_ID < 80600
412+ if (ZEND_USER_CODE (EX (func )-> type ))
413+ #else
414+ if (ZEND_USER_CODE (EX (func )-> type ) || EX (func )-> internal_function .arg_info )
415+ #endif
416+ {
412417 zend_array * symbol_table = zend_rebuild_symbol_table ();
413418 zend_string * symbol ;
414419 zval * variable ;
@@ -422,6 +427,7 @@ static void dd_log_probe_capture_snapshot(ddog_DebuggerCapture *capture, dd_log_
422427 ddog_snapshot_add_field (capture , type , name_slice , capture_value );
423428 }
424429 } ZEND_HASH_FOREACH_END ();
430+ #if PHP_VERSION_ID < 80600
425431 } else if (EX (func )-> internal_function .arg_info ) {
426432 uint32_t num_args = EX (func )-> internal_function .num_args ;
427433 for (uintptr_t i = 0 ; i < num_args ; ++ i ) {
@@ -432,6 +438,7 @@ static void dd_log_probe_capture_snapshot(ddog_DebuggerCapture *capture, dd_log_
432438 ddtrace_create_capture_value (EX_VAR_NUM (i ), & capture_value , capture_config , capture_config -> max_reference_depth );
433439 ddog_snapshot_add_field (capture , DDOG_FIELD_TYPE_ARG , name_slice , capture_value );
434440 }
441+ #endif
435442 }
436443 if (hasThis ()) {
437444 struct ddog_CaptureValue capture_value = {0 };
@@ -978,7 +985,18 @@ static const void *dd_eval_fetch_identifier(void *ctx, const ddog_CharSlice *nam
978985 zend_execute_data * execute_data = eval_ctx -> frame ;
979986
980987 if (EX (func )) {
981- if (ZEND_USER_CODE (EX (func )-> type )) {
988+ #if PHP_VERSION_ID < 80600
989+ if (!ZEND_USER_CODE (EX (func )-> type )) {
990+ int call_args = MIN (EX_NUM_ARGS (), EX (func )-> common .num_args );
991+ for (int i = 0 ; i < call_args ; ++ i ) {
992+ const char * argname = EX (func )-> internal_function .arg_info [i ].name ;
993+ if (zend_binary_strcmp (argname , strlen (argname ), name -> ptr , name -> len ) == 0 ) {
994+ return EX_VAR_NUM (i );
995+ }
996+ }
997+ } else
998+ #endif
999+ {
9821000 zend_execute_data * current_execute_data = EG (current_execute_data );
9831001 EG (current_execute_data ) = execute_data ;
9841002 zend_array * symtable = zend_rebuild_symbol_table ();
@@ -990,14 +1008,6 @@ static const void *dd_eval_fetch_identifier(void *ctx, const ddog_CharSlice *nam
9901008 if (zvp ) {
9911009 return zvp ;
9921010 }
993- } else {
994- int call_args = MIN (EX_NUM_ARGS (), EX (func )-> common .num_args );
995- for (int i = 0 ; i < call_args ; ++ i ) {
996- const char * argname = EX (func )-> internal_function .arg_info [i ].name ;
997- if (zend_binary_strcmp (argname , strlen (argname ), name -> ptr , name -> len ) == 0 ) {
998- return EX_VAR_NUM (i );
999- }
1000- }
10011011 }
10021012 }
10031013
0 commit comments