2121use Reli \Lib \Elf \Parser \ElfParserException ;
2222use Reli \Lib \Elf \Tls \TlsFinderException ;
2323use Reli \Lib \PhpProcessReader \PhpGlobalsFinder ;
24+ use Reli \Lib \PhpProcessReader \PhpVersionDetector ;
2425use Reli \Lib \Process \MemoryReader \MemoryReaderException ;
2526use Reli \Lib \Elf \Process \ProcessSymbolReaderException ;
2627use Symfony \Component \Console \Command \Command ;
@@ -37,6 +38,7 @@ public function __construct(
3738 private TargetPhpSettingsFromConsoleInput $ target_php_settings_from_console_input ,
3839 private TargetProcessSettingsFromConsoleInput $ target_process_settings_from_console_input ,
3940 private TargetProcessResolver $ target_process_resolver ,
41+ private PhpVersionDetector $ php_version_detector ,
4042 private RetryingLoopProvider $ retrying_loop_provider ,
4143 ) {
4244 parent ::__construct ();
@@ -65,11 +67,16 @@ public function execute(InputInterface $input, OutputInterface $output): int
6567
6668 $ process_specifier = $ this ->target_process_resolver ->resolve ($ target_process_settings );
6769
70+ $ target_php_settings_version_decided = $ this ->php_version_detector ->decidePhpVersion (
71+ $ process_specifier ,
72+ $ target_php_settings
73+ );
74+
6875 // see the comment at GetTraceCommand::execute()
6976 $ eg_address = $ this ->retrying_loop_provider ->do (
7077 try: fn () => $ this ->php_globals_finder ->findExecutorGlobals (
7178 $ process_specifier ,
72- $ target_php_settings
79+ $ target_php_settings_version_decided
7380 ),
7481 retry_on: [\Throwable::class],
7582 max_retry: 10 ,
0 commit comments