ID:               14406
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Closed
 Bug Type:         Feature/Change Request
 Operating System: all
 PHP Version:      4.1.0
 New Comment:

 There will be "instanceof" in PHP5.




Previous Comments:
------------------------------------------------------------------------

[2001-12-10 10:44:04] [EMAIL PROTECTED]

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 this bug report at http://bugs.php.net/?id=14406&edit=1

Reply via email to