Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Generates a storable representation of a value
<?php serialize(mixed $value): string
<?php     public function generateCacheKeys($sql, $params, $types, array $connectionParams = [])

    {

        $realCacheKey = 'query=' . $sql .

            '&params=' . serialize($params) .

            '&types=' . serialize($types) .

            '&connectionParams=' . hash('sha256', serialize($connectionParams));
<?php     {

        $realCacheKey = 'query=' . $sql .

            '&params=' . serialize($params) .

            '&types=' . serialize($types) .

            '&connectionParams=' . hash('sha256', serialize($connectionParams));
<?php         $realCacheKey = 'query=' . $sql .

            '&params=' . serialize($params) .

            '&types=' . serialize($types) .

            '&connectionParams=' . hash('sha256', serialize($connectionParams));




        if ($this->cacheKey === null) {
<?php     public function convertToDatabaseValue($value, AbstractPlatform $platform)

    {


        return serialize($value);

    }
<?php     public function convertToDatabaseValue($value, AbstractPlatform $platform)

    {

        return serialize($value);

    }
<?php     public function testArrayConvertsToPHPValue(): void

    {

        self::assertIsArray($this->type->convertToPHPValue(serialize([]), $this->platform));

    }



    public function testConversionFailure(): void
<?php     public function testFalseConversion(): void

    {

        self::assertFalse($this->type->convertToPHPValue(serialize(false), $this->platform));

    }

}
<?php     public function testObjectConvertsToPHPValue(): void

    {

        self::assertIsObject($this->type->convertToPHPValue(serialize(new stdClass()), $this->platform));

    }



    public function testConversionFailure(): void
<?php     public function testFalseConversion(): void

    {

        self::assertFalse($this->type->convertToPHPValue(serialize(false), $this->platform));

    }

}