public function queryWithParam(string $query, array $param): PDOStatement
    {
        $statement = $this->prepare($query);

        foreach ($param as $value) {
            $this->checkValue($value);

            //reassign as reference
            //because bindParam need it as reference
            $ref = $value;
            $ref[1] = &$value[1];

            \call_user_func_array([$statement, "bindParam"], $ref);
        }

        $this->lastOperationStatus = $statement->execute();

        return $statement;
    }
public function queryWithParam(string $query, array $param): PDOStatement
    {
        $statement = $this->prepare($query);

        foreach ($param as $value) {
            $this->checkValue($value);

            //reassign as reference
            //because bindParam need it as reference
            $ref = $value;
            $ref[1] = &$value[1];

            \call_user_func_array([$statement, "bindParam"], $ref);
        }

        $this->lastOperationStatus = $statement->execute();

        return $statement;
    }
public function queryWithParam ( string $ query , array $ param ) : PDOStatement { $ statement = $ this -> prepare ( $ query ) ; foreach ( $ param as $ value ) { $ this -> checkValue ( $ value ) ; //reassign as reference //because bindParam need it as reference $ ref = $ value ; $ ref [ 1 ] = & $ value [ 1 ] ; \ call_user_func_array ( [ $ statement , "bindParam" ] , $ ref ) ; } $ this -> lastOperationStatus = $ statement -> execute ( ) ; return $ statement ; }
Executes an SQL statement with parameters,
returning a result set as a PDOStatement object

@param string $query SQL statement
@param array  $param Parameter as array as PDOStatement::bindParam

@return PDOStatement
Executes an SQL statement with parameters returning a result set as a PDOStatement object