It's only a minor nuisance, but in order to use __CLASS__ with instanceof I have to assign __CLASS__ to a variable first. Should I bother submitting a bug report for this? Or am I perhaps missing something...


<?php

class Test {
  function checkObj2()
  {
    //workaround
    $class = __CLASS__;
    if ($this instanceof $class) {
      return TRUE;
    } else {
      return FALSE;
    }
  }

  function checkObj()
  {
    // this causes a parsing error
    // return ($this instanceof __CLASS__);
  }
}

$t = new Test();
echo $t->checkObj2() ? 'TRUE' : 'FALSE';
echo $t->checkObj();  // can't even test it

?>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to