21
21
use Reli \Lib \Elf \Parser \ElfParserException ;
22
22
use Reli \Lib \Elf \Tls \TlsFinderException ;
23
23
use Reli \Lib \PhpProcessReader \PhpGlobalsFinder ;
24
+ use Reli \Lib \PhpProcessReader \PhpVersionDetector ;
24
25
use Reli \Lib \Process \MemoryReader \MemoryReaderException ;
25
26
use Reli \Lib \Elf \Process \ProcessSymbolReaderException ;
26
27
use Symfony \Component \Console \Command \Command ;
@@ -37,6 +38,7 @@ public function __construct(
37
38
private TargetPhpSettingsFromConsoleInput $ target_php_settings_from_console_input ,
38
39
private TargetProcessSettingsFromConsoleInput $ target_process_settings_from_console_input ,
39
40
private TargetProcessResolver $ target_process_resolver ,
41
+ private PhpVersionDetector $ php_version_detector ,
40
42
private RetryingLoopProvider $ retrying_loop_provider ,
41
43
) {
42
44
parent ::__construct ();
@@ -65,11 +67,16 @@ public function execute(InputInterface $input, OutputInterface $output): int
65
67
66
68
$ process_specifier = $ this ->target_process_resolver ->resolve ($ target_process_settings );
67
69
70
+ $ target_php_settings_version_decided = $ this ->php_version_detector ->decidePhpVersion (
71
+ $ process_specifier ,
72
+ $ target_php_settings
73
+ );
74
+
68
75
// see the comment at GetTraceCommand::execute()
69
76
$ eg_address = $ this ->retrying_loop_provider ->do (
70
77
try: fn () => $ this ->php_globals_finder ->findExecutorGlobals (
71
78
$ process_specifier ,
72
- $ target_php_settings
79
+ $ target_php_settings_version_decided
73
80
),
74
81
retry_on: [\Throwable::class],
75
82
max_retry: 10 ,
0 commit comments