Based on the docs:
/*
Set environment refresh rate with polling manager.
This also enables local evaluation.
Optional.
Defaults to null
*/
int $environmentTtl = null,
enableLocalEvaluation will only be enabled if I provide environmentTtl through the constructor new Flagsmith("KEY", null, null, 100) ,
but not when you do (new Flagsmith("KEY"))->withEnvironmentTtl(100)... because $this->enableLocalEvaluation is only set in the constructor.
class Flagsmith
{
public function __construct(
string $apiKey = null,
string $host = null,
object $customHeaders = null,
int $environmentTtl = null,
...
) {
$this->enableLocalEvaluation = !is_null($environmentTtl);
I do expect that the current API withEnvironmentTtl set enableLocalEvaluation to true.
But ideally other flagsmith clients do have a more explict API, for example, the Java client has .withLocalEvaluation(true), python has enable_local_evaluation , JavaScript has enableLocalEvaluation.