Using PDO in Zephir

The Zephir documentation has now discussion regarding the use of other PHP extensions. Currently I am trying to use the PDO extension. However, when I translate

 $dbh = new PDO("mysql:host=localhost;dbname=dbn;charset=utf8","user","passws");


var dbh = $new PDO("mysql:host=localhost;dbname=dbn;charset=utf8","user","passws");

I get an error. I assumed that this had something to do with namespaces so I stuck in a use \PDO at the top of the file upon which I get

var dbh = $new \PDO::PDO("mysql:host=localhost;dbname=dbn;charset=utf8","user","passws");

It is not clear to me what might be wrong here. I hope that someone here might be able to help.


var dbh;
let dbh = new \Pdo(...);

In my case, I code this way..

namespace Db\Connection;

class Pdo extends DbConnectionAdapter
    protected pdo;

    public function __construct() -> void
        let this->pdo = (new \ReflectionClass("PDO"))->newInstanceArgs(func_get_args());


Thanks that moves me forward a bit. However, I have no idea what is happening here. What is ReflectionClass? Googling for Zephir ReflectionClass has not turned up anything useful. Is there some place where I can read up on it? Also, what next? I got to

let dbh = (new \ReflectionClass("PDO"))->newInstanceArgs(conn,"user","pwd");
let cnt = dbh->exec("SELECT COUNT(*) FROM `names`");

which zephir build did not like.

Pdo run correctly:

var pdo = null; let pdo = new \Pdo("dsn:..", "user", "pass");