array_shift

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Shift an element off the beginning of array
<?php array_shift(array &$array): mixed
<?php         $data = [];



        foreach ($this->fetchAllAssociative() as $row) {

            $data[array_shift($row)] = $row;

        }



        return $data;
<?php     public function iterateAssociativeIndexed(): Traversable

    {

        foreach ($this->iterateAssociative() as $row) {

            yield array_shift($row) => $row;

        }

    }
<?php         $columns = [];



        foreach ($this->_columns as $column) {

            $length = array_shift($subParts);



            $quotedColumn = $column->getQuotedName($platform);
<?php     protected function _getPortableTableDefinition($table)

    {

        return array_shift($table);

    }
<?php     protected function _getPortableTableDefinition($table)

    {

        $schemas     = $this->getExistingSchemaSearchPaths();

        $firstSchema = array_shift($schemas);



        if ($table['schema_name'] === $firstSchema) {

            return $table['table_name'];
<?php     {

        $expectedResult = [];

        foreach ($this->expectedResult as $v) {

            $expectedResult[] = array_shift($v);

        }



        $this->assertCacheNonCacheSelectSameFetchModeAreEqual(
<?php         $sql = $this->platform->getCreateTableSQL($table);

        self::assertEquals(

            'CREATE TABLE Foo (Bar INT NOT NULL) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB',

            array_shift($sql)

        );

    }
<?php         $constraints = $tableA->getForeignKeys();



        self::assertCount(1, $constraints);

        self::assertSame($constraint, array_shift($constraints));

    }



    public function testOptions(): void