Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Find whether the type of a variable is string
is_string(mixed $value): bool
    public function define($ability$callback)

    {

        if (
is_array($callback) && isset($callback[0]) && is_string($callback[0])) {

            
$callback $callback[0].'@'.$callback[1];

        }
        if (is_callable($callback)) {

            
$this->abilities[$ability] = $callback;

        } elseif (
is_string($callback)) {

            
$this->stringCallbacks[$ability] = $callback;



            
$this->abilities[$ability] = $this->buildAbilityCallback($ability$callback);
        }



        if (
is_array($class)) {

            
$className is_string($class[0]) ? $class[0] : get_class($class[0]);



            return 
$this->methodAllowsGuests($className$class[1]);

        }
            $class get_class($class);

        }



        if (! 
is_string($class)) {

            return;

        }
        if (isset($arguments[0]) && is_string($arguments[0])) {

            
array_shift($arguments);

        }
    protected function properString()

    {

        return 
is_string($this->recaller) && str_contains($this->recaller'|');

    }
    {

        if (
$channel instanceof HasBroadcastChannel) {

            
$channel $channel->broadcastChannelRoute();

        } elseif (
is_string($channel) && class_exists($channel) && is_a($channelHasBroadcastChannel::class, true)) {

            
$channel = (new $channel)->broadcastChannelRoute();

        }
    {

        if (
is_callable($callback)) {

            return (new 
ReflectionFunction($callback))->getParameters();

        } elseif (
is_string($callback)) {

            return 
$this->extractParametersFromClass($callback);

        }
    public function many(array $keys)

    {

        
$values $this->store->many(collect($keys)->map(function ($value$key) {

            return 
is_string($key) ? $key $value;

        })->
values()->all());



        return 
collect($values)->map(function ($value$key) use ($keys) {
        $return = [];



        
$keys collect($keys)->mapWithKeys(function ($value$key) {

            return [
is_string($key) ? $key $value => is_string($key) ? $value null];

        })->
all();



        foreach (
$keys as $key => $default) {
    protected static function explodePluckParameters($value$key)

    {

        
$value is_string($value) ? explode('.'$value) : $value;



        
$key is_null($key) || is_array($key) ? $key explode('.'$key);
                $ascending Arr::get($comparison1true) === true ||

                             
Arr::get($comparison1true) === 'asc';



                if (! 
is_string($prop) && is_callable($prop)) {

                    
$result $prop($a$b);

                } else {

                    
$values = [data_get($a$prop), data_get($b$prop)];
    protected function explodePluckParameters($value$key)

    {

        
$value is_string($value) ? explode('.'$value) : $value;



        
$key is_null($key) || is_array($key) ? $key explode('.'$key);
            $retrieved data_get($item$key);



            
$strings array_filter([$retrieved$value], function ($value) {

                return 
is_string($value) || (is_object($value) && method_exists($value'__toString'));

            });



            if (
count($strings) < && count(array_filter([$retrieved$value], 'is_object')) == 1) {
    protected function useAsCallable($value)

    {

        return ! 
is_string($value) && is_callable($value);

    }