is_callable

Supported Versions: PHP 4 >= 4.0.6, PHP 5, PHP 7, PHP 8
Verify that a value can be called as a function from the current scope.
<?php is_callable(mixed $value, bool $syntax_only = false, string &$callable_name = null): bool
<?php     {

        collect($this->items)

            ->filter(function ($item) {

                return is_callable($item->children()) && $item->isActive();

            })

            ->each(function ($item) {

                $item->children($item->children()());
<?php     {

        collect($this->items)

            ->reject(function ($item) {

                return is_callable($item->children());

            })

            ->each(function ($item) {

                $item->children($this->filterAuthorizedNavItems($item->children()));
<?php             return $this->children;

        }



        if (is_callable($items)) {

            $this->children = $items;



            return $this;
<?php     public static function jsonVariables(Request $request)

    {

        return collect(static::$jsonVariables)->map(function ($variable) use ($request) {

            return is_callable($variable) && ! is_string($variable) ? $variable($request) : $variable;

        })->all();

    }
<?php     public static function modifyMultiple($string, $modifications)

    {

        foreach ($modifications as $modification) {

            $string = is_callable($modification)

                ? $modification($string)

                : self::$modification($string);

        }
<?php             return $value->getBags() ? 'true' : 'false';

        } elseif (is_array($value)) {

            return ! empty($value) ? 'true' : 'false';

        } elseif (is_object($value) and is_callable([$value, '__toString'])) {

            return var_export((string) $value, true);

        } elseif (is_object($value)) {

            return 'true';
<?php             });



        $this->assertEquals('Security Droids', $item->name());

        $this->assertTrue(is_callable($item->children()));



        $item = Nav::build()->get('Droids')->first();
<?php         $item = Nav::build()->get('Droids')->first();



        $this->assertEquals('Security Droids', $item->name());

        $this->assertFalse(is_callable($item->children()));

        $this->assertEquals('IG-86', $item->children()->get(0)->name());

        $this->assertEquals('K-2SO', $item->children()->get(1)->name());

    }