Re: To go further
I’m not sure I see that as the cause of this particular issue as it occurs in Python rather than PHP, and I personally expect a constructor to be evaluated when it is called rather than when it is defined. Perhaps that’s just me though! A fairer comparison might be with temporary loop counter variables such as for( $i = 0; $i < count( $array ); ++$i ) { ... } going out of scope when the loop ends, but again that’s a construct that’s rarely used in Python.
Thu, 07/01/2016 - 16:45
Permalink