Skip to content

Phalcon\Db\Adapter\Pdo messes up the input data #2111

Closed
@iby

Description

@iby

That drove me ABSOLUTE NUTTTTS!!! After making this call with $params array of int values, those values become strings.

var_dump($params); // array(2) { [0]=> int(6609) [1]=> int(6664) }
$adapter->fetchAll($sql, Db::FETCH_ASSOC, $params);
var_dump($params); // array(2) { [0]=> string(4) "6609" [1]=> string(4) "6664" }

It's crazy, even if I do array_values I end up with the same shit:

$adapter->fetchAll($sql, Db::FETCH_ASSOC, array_values($params));

Can we not use references in such calls? When we use references in C, does it actually help with anything or are they treated by zend compiler in the same way they are in PHP? Because if they do – it might be completely pointless. This might be a really dumb question, sorry, I'm taking the shot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    not a bugReported issue is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions