Re: weak and strict type checking RFC

From: Date: Sat, 04 Jul 2009 12:27:17 +0000
Subject: Re: weak and strict type checking RFC
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-44696@lists.php.net to get a copy of this message
On Sat, 4 Jul 2009, Lukas Kahwe Smith wrote: > I am publishing it a bit prematurely imho, but its not without merit > at this stage either and since I will be busy playing frisbee all > weekend, I thought I get it out there for people to comment right now: > http://wiki.php.net/rfc/typecheckingstrictandweak Like Ilia mentioned on IRC, there is no reason why the strict type checking which he proposes is necessarily a conflict with the weak type checking. So I would much rather have seen an RFC where you are trying to make a case why we would need week type checking, instead of saying that strict type checking is bad. You might not agree with the strict type checking, but people ask for it, people have been using it and there are plenty of reasons why it is useful—whether you see it or not. So I would propose to: 1. have ilia's strict typing patch (minus scalar and numeric) 2. have a patch that also adds for casting type hints from your RFC. Those could (and should) be considered as *two* new features. As for syntax, I believe the following would be best: function add_user(string $name, string $phone_number, (int) $age) { .. } because: 1. the casting type hint "(int) $var" is used for normal casting already 2. the strict type hint "int $var" is already used for class names regards, Derick -- http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org twitter: @derickr

« previous php.internals (#44696) next »