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

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <p> <br> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Web page addresses and email addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA