Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Opens file or URL
<?php fopen(    string $filename,    string $mode,    bool $use_include_path = false,    ?resource $context = null): resource|false
<?php         }



        if (is_string($value)) {

            $fp = fopen('php://temp', 'rb+');

            assert(is_resource($fp));

            fwrite($fp, $value);

            fseek($fp, 0);
<?php         }



        if (is_string($value)) {

            $fp = fopen('php://temp', 'rb+');

            assert(is_resource($fp));

            fwrite($fp, $value);

            fseek($fp, 0);
<?php         $this->connection->insert('blob_table', [

            'id'        => 1,

            'clobcolumn' => 'ignored',

            'blobcolumn' => fopen('data://text/plain,' . $longBlob, 'r'),

        ], [

            ParameterType::INTEGER,

            ParameterType::STRING,
<?php         $this->connection->update('blob_table', [

            'id'          => 1,

            'blobcolumn'   => fopen('data://text/plain,test2', 'r'),

        ], ['id' => 1], [

            ParameterType::INTEGER,

            ParameterType::LARGE_OBJECT,
<?php         $stmt->bindParam(1, $stream, ParameterType::LARGE_OBJECT);




        $stream = fopen('data://text/plain,test', 'r');



        $stmt->execute();
<?php     public function testBinaryResourceConvertsToPHPValue(): void

    {

        $databaseValue = fopen('data://text/plain;base64,' . base64_encode('binary string'), 'r');

        $phpValue      = $this->type->convertToPHPValue($databaseValue, $this->platform);



        self::assertSame($databaseValue, $phpValue);
<?php     public function testBinaryResourceConvertsToPHPValue(): void

    {

        $databaseValue = fopen('data://text/plain;base64,' . base64_encode($this->getBinaryString()), 'r');

        $phpValue      = $this->type->convertToPHPValue($databaseValue, $this->platform);



        self::assertSame($databaseValue, $phpValue);
<?php     public function testJsonResourceConvertsToPHPValue(): void

    {

        $value         = ['foo' => 'bar', 'bar' => 'foo'];

        $databaseValue = fopen('data://text/plain;base64,' . base64_encode(json_encode($value)), 'r');

        $phpValue      = $this->type->convertToPHPValue($databaseValue, $this->platform);



        self::assertSame($value, $phpValue);