Re: Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.h zend_execute.c zend_language_parser.y zend_language_scanner.l
zend_operators.c zend_operators.h

From: Date: Mon, 05 Aug 2002 04:09:53 +0000
Subject: Re: Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_compile.h zend_execute.c zend_language_parser.y zend_language_scanner.l
zend_operators.c zend_operators.h
References: 1 2 3 4 5 6  Groups: php.dev 
Request: Send a blank email to php-dev+get-86522@lists.php.net to get a copy of this message
At 07:04 AM 8/5/2002 +0300, Andi Gutmans wrote:
At 03:35 PM 8/4/2002 -0400, Andrei Zmievski wrote:
On Sat, 03 Aug 2002, Andi Gutmans wrote: Don't you think we should have a unified way of testing for variable's type/class? I understand that we don't have type unification yet, but having a separate function for each basic type is kind of ugly too.
I'd prefer "is" to be an OOP only construct. i.e. for anything other than an object it'd return false. Just some food for though before we finalize this. This operator will be a reserved word. Are we sure we want "is" to be a reserved word? It might be used quite a bit.
I think it's fine to use is as reserved. Other languages (C# for example) uses 'is' for this purpose. By the way, if you don't like casting notation, Alan had an idea to use this one: $a is 'int' $a is 'Foo::Bar' Would that work?
Nope doesn't work for me. I don't see a reason why to start doing all kinds of weird stuff when we have rules for Foo::Bar. Classes shouldn't look different in an "is" statement than in a "catch" statement IMO.
I'll try and get it to work in a decent way "$a is int". I wasn't successful last time but maybe I'll have a good idea. We should choose only one name for each type though (we discussed it some time ago) because they will become reserved words and I suggest to deprecate the casts (maybe with a new E_DEPRECATE) which use the forms we don't choose. Andi

« previous php.dev (#86522) next »