Scope of PDO used in a function

May 21, 2013 in answer

0 votes, 0.00 avg. rating (0% score)

ANSWER:

After bar $dbo will be “destroyed”.

Variable containers get destroyed when the “refcount” reaches zero. The “refcount” gets decreased by one when any symbol linked to the variable container leaves the scope (e.g. when the function ends) or when unset() is called on a symbol.

Reference Counting Basics

sectus from http://stackoverflow.com/questions/16681556