A freed statement is not "empty()", it's still a resource:
<?php
$con=oci_connect();
$q=oci_parse($con,"SELECT sysdate FROM dual");
var_dump($q); var_dump(empty($q)); var_dump(oci_statement_type($q)); echo "------\n";
oci_execute($q);
var_dump($q); var_dump(empty($q));
var_dump(oci_statement_type($q));
echo "------\n";
oci_free_statement($q);
var_dump($q); var_dump(empty($q)); var_dump(oci_statement_type($q)); oci_close($con);
?>
So far I can not think of a way to determine if a statement is freed without using an additional flag...