I\'m utilizing a Mysql based PDO connection with PDOStatement (::prepare()
; ::execute()
) and I\'ve run over some code from a
pdo_mysql_stmt_dtor() runs the same cleanup operations as pdo_mysql_stmt_cursor_closer(), so as long as the statement object is either explicitly unset or goes out of scope, the operations will always be performed.
It is therefore not strictly necessary to call closeCursor()
if the statement is about to be destroyed anyway. Personally I would do it anyway as I like to be explicit for readability, but that comes down to personal stylistic preferences.
Based on the references above, this can only be said for certain about PDO_mysql - for other drivers this may not hold true.