Re: Really Need..
| From: | Nathan Rixham | Date: | Sun, 18 Jan 2009 21:39:27 +0000 |
| Subject: | Re: Really Need.. | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-42687@lists.php.net to get a copy of this message | ||
Hannes Magnusson wrote:
On Sun, Jan 18, 2009 at 17:42, Lukas Kahwe Smith <mls@pooteeweet.org> wrote: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. NathanOn 17.01.2009, at 18:06, Nathan Rixham wrote:It doesn't throw E_FATAL. It throws E_RECOVERABLE_ERROR which doesn't do anything.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