At 09:55 PM 8/9/2005 +0200, Pierre-Alain Joye wrote:
On Tue, 09 Aug 2005 12:44:59 -0700
Andi Gutmans <[EMAIL PROTECTED]> wrote:
> But that's a good point. For the few frameworks that might
> require such functionality they can use class_exists() or other
> methods. That doesn't mean we should change instanceof for
> mainstream usage which is 99.99%.
Where do you get this percentage?
Do a fgrep -rn is_a\( in PEAR for example. And please no stupid
comments (not you Andi the evil other ;)).
There is plenty of good reasons to do this check.
You are missing my point. I didn't say people don't use is_a(). There is a
lot of PHP 4 compatible code which you'll find is_a() in. I said the amount
of instances where you actually require the proposed behavior is neglgible.
It happens with plug-in architectures which generally speaking, tend to
also use Reflection functions (incl. class_exists, function_eixsts, etc.).
> In all languages, frameworks do some trickier stuff. In Java they
> often mess with the ClassLoader, in C++ they deal with DSOs.
These are _compiled_, _linked_ languages. The simple fact that you
cannot compile your sources explain the tricks. PHP is (should I
say was?) mostly a dynamic and scripting language.
Being a dynamically typed language doesn't mean everything should be
dynamic. Does it mean we have to allow adding PPP properties/methods on the
fly, allow for dynamic type hints ($ClassName $obj), and so on? I'm not
expecting you to answer these questions but being dynamically typed doesn't
mean the whole language is dynamic. That doesn't mean you can't/shouldn't
argue your point, but I think this is a bad reason.
> This kind of development
> paradigm is not mainstream and as long as there's a way to
> achieve it, then that's what's important.
What is important to me is that "you" deprecate things without
acceptable alternatives.
Did I deprecate it? And yes, as I mentioned there is an acceptable
alternative, although it seems it's not acceptable to you. I can't argue
that point as it's how you feel.
> Even the people that mentioned it's soooo important. I bet that
> if I look at their code, there's maybe 1 instance that actually
> would need this (if at all).
Wrong....
We must be looking at completely different applications.
Andi
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php