I searched for the answer to this question, but found nothing. Are the calls in PDO :: prepare () cached or should I cache the result myself, that is, if I do the following
function foo () {
$handle = PDO::prepare(...);
}
will the prepare () command be cached by PDO to quickly get the second, third, etc.? Or is it better to do it yourself, for example.
function foo() {
static $handle = null;
if (!$handle) {
$handle = PDO::prepare(...);
}
}
source
share