Re: [RFC] Scalar Type Hints v0.2

From: Date: Thu, 15 Jan 2015 11:36:29 +0000
Subject: Re: [RFC] Scalar Type Hints v0.2
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-80533@lists.php.net to get a copy of this message
Hey: On Thu, Jan 15, 2015 at 6:42 AM, Andrea Faulds <ajf@ajf.me> wrote: > Hey Dmitry, > >> On 14 Jan 2015, at 20:40, Dmitry Stogov <dmitry@zend.com> wrote: >> >> In my opinion, version 0.1 was consistent enough. >> >> handling two different approaches just makes mess... >> >> We have internal function strlen(string $s), and it may be called with integer argument >> e.g. strlen(123) -> 3 >> I think user functions should follow the same rules. > > This RFC does that. In the “weak” mode that would continue work, and it would also for > userland functions with scalar type hints. In the “strict” mode that would break, and it would > also break for a similar userland function with a scalar type hint. sounds like a hell to me..... sorry for saying that, but I don't like the whole "declare" thing... could we please strict to v0.1, only make it first ? thanks > >> >> If some rules are "bad", lets change that rules for both internal and user >> functions. >> But it's better to do it in a separate RFC (after scalar type hinting 0.1 accepted), >> or we will stick forever. > > I’m not sure the weak typing approach to function parameters is bad per se, but a lot of > developers would certainly prefer the strict typing approach. That’s why the RFC allows choice: > for all the people that weak typing works for, good, you can keep using that. The people who want > strict typing get strict typing without forcing the people who want weak typing to use it. > > Thanks. > -- > Andrea Faulds > http://ajf.me/ > > > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > -- Xinchen Hui @Laruence http://www.laruence.com/

« previous php.internals (#80533) next »