2, ]); } else if (class_exists(Psr18Client::class)) { $httpClient = HttpClient::create([ 'timeout' => 2, ]); $httpClient = new Psr18Client($httpClient); } else { throw new LogicException('No supported http client (for this example) found'); } $unleash = UnleashBuilder::create() ->withAppName($appName) ->withAppUrl($appUrl) ->withInstanceId($instanceId) ->withHttpClient($httpClient) ->withHeader('Authorization', $apiKey) ->build() ; if ($unleash->isEnabled('myFeature')) { echo "myFeature is enabled"; } else { echo "myFeature is disabled"; }