diff --git a/agent/native/ext/lifecycle.cpp b/agent/native/ext/lifecycle.cpp index 0291c2f1a..0e55f83bb 100644 --- a/agent/native/ext/lifecycle.cpp +++ b/agent/native/ext/lifecycle.cpp @@ -162,11 +162,10 @@ void elasticApmZendThrowExceptionHookImpl( resetLastThrown(); #if PHP_MAJOR_VERSION >= 8 /* if PHP version is 8.* and later */ - zval thrownAsZval; - zval* thrownAsPzval = &thrownAsZval; - ZVAL_OBJ_COPY( /* dst: */ thrownAsPzval, /* src: */ thrownAsPzobj ); + ZVAL_OBJ_COPY(&ELASTICAPM_G( lastException ), thrownAsPzobj ); +#else + ZVAL_COPY(&ELASTICAPM_G(lastException), thrownAsPzval ); #endif - ZVAL_COPY( /* pZvalDst: */ &ELASTICAPM_G(lastException), /* pZvalSrc: */ thrownAsPzval ); ELASTIC_APM_LOG_DEBUG_FUNCTION_EXIT(); } @@ -577,7 +576,7 @@ void elasticApmRequestShutdown() ELASTIC_APM_LOG_DEBUG( "opcache.preload request detected on shutdown" ); return; } - + if (ELASTICAPM_G(globals)->periodicTaskExecutor_) { ELASTIC_APM_LOG_DEBUG("pausing inferred spans thread"); ELASTICAPM_G(globals)->periodicTaskExecutor_->suspendPeriodicTasks(); @@ -681,4 +680,4 @@ ResultCode elasticApmEnterAgentCode( String dbgCalledFromFile, int dbgCalledFrom failure: goto finally; -} \ No newline at end of file +} diff --git a/tests/ElasticApmTests/ComponentTests/Util/BuiltinHttpServerAppCodeHostStarter.php b/tests/ElasticApmTests/ComponentTests/Util/BuiltinHttpServerAppCodeHostStarter.php index e327f9fdb..4b04ef3d2 100644 --- a/tests/ElasticApmTests/ComponentTests/Util/BuiltinHttpServerAppCodeHostStarter.php +++ b/tests/ElasticApmTests/ComponentTests/Util/BuiltinHttpServerAppCodeHostStarter.php @@ -74,7 +74,7 @@ protected function buildCommandLine(array $ports): string { Assert::assertCount(1, $ports); return InfraUtilForTests::buildAppCodePhpCmd($this->agentConfigSourceBuilder->getPhpIniFile()) - . " -S localhost:" . $ports[0] + . " -S 0.0.0.0:" . $ports[0] . ' "' . FileUtilForTests::listToPath([__DIR__, self::APP_CODE_HOST_ROUTER_SCRIPT]) . '"'; }