Skip to content

[BUG]: PHP 8 db->delete throw exception if not pass empty array #15363

Closed
@renatogabrielbr

Description

@renatogabrielbr

Works on update and insert.
Throw exception if not pass empty array as third argument.

PHP 8.0.3 
Version | 4.1.0
Build Date | Apr 1 2021 10:53:26
Powered by Zephir | Version 0.13.0-d89a471

$db = \Phalcon\Db\Adapter\Pdo\Postgresql

$this->db->delete('logs.test', 'updated_at < :date', [
            'date' => $this->dateHandler->newDateTimeInstance()
            ->substract()
        ]);

Throws

Phalcon\Db\Adapter\Pdo\AbstractPdo::execute(): Argument #3 ($bindTypes) must be of type array, null given

But if i pass as third argument an empty array works.

$this->db->delete('logs.test', 'updated_at < :date', [
            'date' => $this->dateHandler->newDateTimeInstance()
            ->substract()
        ],
[]); // EMPTY ARRAY

Metadata

Metadata

Assignees

Labels

5.0The issues we want to solve in the 5.0 releasebreaks bcFunctionality that breaks Backwards CompatibilitybugA bug reportstatus: highHigh

Type

No type

Projects

Status

Released

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions