Ron Korving wrote:
1) Does unsetting $stmt trigger a closeCursor() as well? I assume so, but the article doesn't mention it. It only talks about the importance of calling that method.
yes this is done automatically ..
2) Could it be a good idea (performance wise) and possible in the first place to maintain a pool of prepared statements? Something like this:
This should be done on the RDBMS end. I havent looked at how PDO does this in detail, but it would be nice to get some more control over this. Some RDBMS will pool this automatically, some do not (AFAIK pgsql will always create a new statement instead of returning a handle to an existing statement). There is a reason why you may want more control over this. One of the key aspects of a prepared statement is that you safe time due to not having to build a query plan on every execution. This may bite you however if you prepare a statement and then things change within the database that would make it more feasible to use a new plan.
3) Wouldn't it be nice if you could do a $stmt->execute("foo", "bar"); (numeric parameters) instead of $stmt->execute(array("foo", "bar")); ?
I think this would severely hurt the extensibility of the API not only for PDO itself, but also for people who want to transparently extend the API.
regards, Lukas -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php