On Thu, Nov 6, 2014 at 1:01 PM, Stas Malyshev <smalys...@sugarcrm.com> wrote:
> You could of course require the expression to always be enclosed in (), > but that produces weird syntax where some forms of instanceof work > without () and some only with (). Given that you can easily assign your > value to a variable, is it worth it? > > Also, you can always use is_a($foo, $bar->getClassName()). > This is exactly what I'm doing right now, requiring the expression to always be enclosed in parenthesis. I think it's way better to be able to do this instead of creating temporary variables just to assign a class name. Also, is_a, since it's a function, is significantly slower than instanceof, which is a construct (but of course you already now that). Daniel Ribeiro http://danielribeiro.org