From:             [EMAIL PROTECTED]
Operating system: all
PHP version:      4.1.0
PHP Bug Type:     Feature/Change Request
Bug description:  typeof operator

First part of code is the same in every way:

class Foo {}
$o = new Foo();

Now there is:

if (get_class($o) == "foo") {
  // ok
} else {
  // not ok
}

I can create walkaround:

function typeof(&$obj, $classname) {
  return (get_class($obj) == strtolower(trim($classname)));
}

if (typeof($o, "Foo"))) {
  // ok
} else {
  // not ok
}

You should make it easier, by new `typeof' operator:

if ($o typeof Foo) {
  // ok
} else {
  // not ok
}

like in JavaScript.
-- 
Edit bug report at: http://bugs.php.net/?id=14406&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to