Hannes Magnusson wrote:
On Sun, Jan 18, 2009 at 17:42, Lukas Kahwe Smith <m...@pooteeweet.org> wrote:
On 17.01.2009, at 18:06, Nathan Rixham wrote:

a: Optional Static Typing
I'm finding an ever increasingly need to be able to staticly type
properties, parameters, return types etc (in classes) I know there is type
hinting but it's just not enough to do what one needs. Additionally support
for staticly typing primatives.
I am not a type hinting fan .. then again I think that PPP is mostly bogus
for a scripting language as well. I would not mind this stuff if it would
just all just throw E_STRICT's instead of E_FATAL. To me the point of a glue

It doesn't throw E_FATAL. It throws E_RECOVERABLE_ERROR which doesn't
do anything.


E_RECOVERABLE_ERROR seems appropriate IMHO

I've reworded my original mail completely maybe this one will have more feedback (or not)

question: Would anybody else like to see, or feel the need for, *optional* type hinting of variables and class properties in PHP?

examples (all optional, and syntax may differ):

class Example {
  private TypeHint $var;
}

Example $var = new Example();

in addition the ability to type hint primatives/scalars/[type object] in the existing implementation:

function(bool $flag) {
}

function(object $flag) {
}


This would all be under the assumption and proviso that an implementation would not break bc, have any markable perfomance hit, or in any other way effect existing applications or new applications that did not use the functionality (in the same way the existing type hinting implementation doesn't)

internals: can anybody confirm if this would even be possible and if so what the "cost" would be?

regards, thanks / apologies where needed etc.

Nathan

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to