Re: [PHP-DEV] Syntactical change to Scalar Type Hints RFC

2015-02-09 Thread Rowan Collins
Pierre Joye wrote on 09/02/2015 00:05: On Mon, Feb 9, 2015 at 6:30 AM, Rowan Collins rowan.coll...@gmail.com wrote: On 08/02/2015 20:33, Zeev Suraski wrote: FWIW, while I think strict types - stricter than even strict languages - don't belong in PHP, this syntax is clearly a step up from

RE: [PHP-DEV] Syntactical change to Scalar Type Hints RFC

2015-02-09 Thread François Laupretre
De : Rowan Collins [mailto:rowan.coll...@gmail.com] Would more strict features be added to this mode later? No. Or would other keywords be added so that you could, ahem, declare several directives at the top of your block? No. I think this is all rather optimistic - if you use a

Re: [PHP-DEV] Syntactical change to Scalar Type Hints RFC

2015-02-09 Thread Rowan Collins
Andrea Faulds wrote on 09/02/2015 00:05: If you're going to go that far, why not just disallow the block-level syntax of declare() for this case, if that is the complaint? Or if the problem is the non-block syntax, why not enforce that a non-block declare(strict_types) be at the top of the

RE: [PHP-DEV] Syntactical change to Scalar Type Hints RFC

2015-02-08 Thread Zeev Suraski
, 2015 9:45 PM To: PHP Internals Subject: [PHP-DEV] Syntactical change to Scalar Type Hints RFC Hi, I’m posting this in a new thread since people might (reasonably) be ignoring further responses to the [VOTE] thread. I’m considering a small change to the Scalar Type Hints RFC, specifically

Re: [PHP-DEV] Syntactical change to Scalar Type Hints RFC

2015-02-08 Thread Andrea Faulds
Hi François, On 8 Feb 2015, at 20:43, François Laupretre franc...@tekwire.net wrote: De : Andrea Faulds [mailto:a...@ajf.me] Instead, I’m wondering if the following might be better: ?php strict Which would be used like so: ?php strict function foobar(): int {

[PHP-DEV] Syntactical change to Scalar Type Hints RFC

2015-02-08 Thread Andrea Faulds
Hi, I’m posting this in a new thread since people might (reasonably) be ignoring further responses to the [VOTE] thread. I’m considering a small change to the Scalar Type Hints RFC, specifically about syntax. Quite a few people have said they don’t like the declare() syntax, and it’s easy to

RE: [PHP-DEV] Syntactical change to Scalar Type Hints RFC

2015-02-08 Thread François Laupretre
De : Andrea Faulds [mailto:a...@ajf.me] Instead, I’m wondering if the following might be better: ?php strict Which would be used like so: ?php strict function foobar(): int { return 1.0; // error! } It’d be a per-file directive, so there’d be zero mixing

Re: [PHP-DEV] Syntactical change to Scalar Type Hints RFC

2015-02-08 Thread Pierre Joye
On Mon, Feb 9, 2015 at 6:30 AM, Rowan Collins rowan.coll...@gmail.com wrote: On 08/02/2015 20:33, Zeev Suraski wrote: FWIW, while I think strict types - stricter than even strict languages - don't belong in PHP, this syntax is clearly a step up from declare(), which was definitely not

Re: [PHP-DEV] Syntactical change to Scalar Type Hints RFC

2015-02-08 Thread Rowan Collins
On 08/02/2015 20:33, Zeev Suraski wrote: FWIW, while I think strict types - stricter than even strict languages - don't belong in PHP, this syntax is clearly a step up from declare(), which was definitely not intended for this purpose. I'm kind of intrigued what purpose it *was* intended for.

Re: [PHP-DEV] Syntactical change to Scalar Type Hints RFC

2015-02-08 Thread Pierre Joye
hi, On Mon, Feb 9, 2015 at 2:44 AM, Andrea Faulds a...@ajf.me wrote: Hi, I’m posting this in a new thread since people might (reasonably) be ignoring further responses to the [VOTE] thread. I’m considering a small change to the Scalar Type Hints RFC, specifically about syntax. Quite a

Re: [PHP-DEV] Syntactical change to Scalar Type Hints RFC

2015-02-08 Thread Rowan Collins
On 09/02/2015 00:05, Andrea Faulds wrote: Secondly, it is less specific than the current proposal - it suggests that PHP has a generic strict mode, rather than a strict type-checking mode. It could be renamed to strict_types, but that loses some elegant. Would more strict features be added

Re: [PHP-DEV] Syntactical change to Scalar Type Hints RFC

2015-02-08 Thread Andrea Faulds
Hi, On 8 Feb 2015, at 23:22, Rowan Collins rowan.coll...@gmail.com wrote: On 08/02/2015 19:44, Andrea Faulds wrote: Hi, I’m posting this in a new thread since people might (reasonably) be ignoring further responses to the [VOTE] thread. Incidentally, you still used reply to create

Re: [PHP-DEV] Syntactical change to Scalar Type Hints RFC

2015-02-08 Thread Pierre Joye
On Mon, Feb 9, 2015 at 3:33 AM, Zeev Suraski z...@zend.com wrote: FWIW, while I think strict types - stricter than even strict languages - don't belong in PHP, this syntax is clearly a step up from declare(), which was definitely not intended for this purpose. I think we get it, you do not

Re: [PHP-DEV] Syntactical change to Scalar Type Hints RFC

2015-02-08 Thread Rowan Collins
On 08/02/2015 19:44, Andrea Faulds wrote: Hi, I’m posting this in a new thread since people might (reasonably) be ignoring further responses to the [VOTE] thread. Incidentally, you still used reply to create this message, so mail readers which base threads on headers (e.g. Thunderbird)