Re: [PHP] instanceof on class (not objects) php 5

2003-07-07 Thread Marek Kilimajer
Maybe

if (new MyClass instanceof_equiv tester) {
...
}
?


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


Re: [PHP] instanceof on class (not objects) php 5

2003-07-07 Thread Greg Beaver
Hi,

I can't instantiate the class, as there is no way to guarantee that the 
constructor doesn't require arguments, and I don't want to halt program 
execution if it doesn't implement tester

Greg

Marek Kilimajer wrote:

Maybe

if (new MyClass instanceof_equiv tester) {
...
}
?






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


[PHP] instanceof on class (not objects) php 5

2003-07-05 Thread Greg Beaver
Hi,

Is it possible to determine whether a class implements an interface 
without instantiating an object of that class?

?php
interface tester {
function doesStuff();
}
class MyClass implements tester {
function doesStuff(){}
}
$var = 'MyClass';

if ($var instanceof_equiv tester) {
...
}
?
I really need this kind of capability to determine whether an argument 
is a valid class for the purposes needed.  I guess if reflection makes 
it into beta 2, I will have what I need, but is there something in beta 1?

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