I do not understand why I am getting the error "Undefined variable this" in
this snippet of code (note for brevity I cut out a lot of code):

<?php
class standardquestion
{
var $private;

function standardquestion($xmlfilename)
{

 $this->private=FALSE;

 <skip some stuff here>

}

function startElementHandler($parser, $name, $attribs)
{
 if ($name=="private")
  $this->private = TRUE;

 if ($this->private==FALSE)                  // <<<<---- Undefined variable
this
  return;
}



As you can see, I initialize the variable as the first line in the
constructor.  But, why is "this" suddenly undefined?  I presume I'm doing
something stupid, but I am new to PHP and am missing something here.

Thanks,

-- Brian



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to