Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Find whether the type of a variable is string
<?php is_string(mixed $value): bool
<?php $basePath = $_SERVER['APP_BASE_PATH'] ?? $_ENV['APP_BASE_PATH'] ?? $serverState['octaneConfig']['base_path'] ?? null;



if (! is_string($basePath)) {

    fwrite(STDERR, 'Cannot find application base path.'.PHP_EOL);



    exit(11);
<?php     public function warm(Application $app, array $services = []): Application

    {

        foreach ($services ?: $app->make('config')->get('octane.warm', []) as $service) {

            if (is_string($service) && $app->bound($service)) {

                $app->make($service);

            }

        }
<?php         $store->interval('foo', fn () => Str::random(10), 1);



        $this->assertTrue(is_string($first = $store->get('foo')));



        Carbon::setTestNow(now()->addMinutes(1));
<?php         $store->refreshIntervalCaches();



        $this->assertTrue(is_string($second = $store->get('foo')));

        $this->assertNotEquals($first, $second);



        Carbon::setTestNow();