Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Extract a slice of the array
<?php array_slice(    array $array,    int $offset,    ?int $length = null,    bool $preserve_keys = false): array
<?php     public function __construct(string $name)

    {

        $this->name = class_basename($name);

        $this->namespace = trim(implode('\\', array_slice(explode('\\', str_replace('/', '\\', $name)), 0, -1)), '\\');

    }



    public function name(): string
<?php     public function __construct($name)

    {

        $this->name = class_basename($name);

        $this->namespace = trim(implode('\\', array_slice(explode('\\', str_replace('/', '\\', $name)), 0, -1)), '\\');

    }



    public function name(): string