Re: [PHP-DEV] What do we need strict scalar type hints for?

2015-02-02 Thread Dmitry Stogov
On Mon, Feb 2, 2015 at 7:47 PM, Paul Dragoonis dragoo...@gmail.com wrote: Hi Dmitry, It's preferred to have flexible scalars, that way we can interchange between a numerical string or an integer. Over defining on such things loses the powerfulness of PHP. So scalar typehints are

Re: [PHP-DEV] What do we need strict scalar type hints for?

2015-02-02 Thread Andrea Faulds
Hi Stas, On 2 Feb 2015, at 18:56, Stanislav Malyshev smalys...@gmail.com wrote: Hi! Keeping that in mind, the declare statement, as ugly as it may look, could be actually a killer to finally get what both camps want but never (and never will) manage to agree. I think having two

[PHP-DEV] [RFC][VOTE] Removal of dead or not yet PHP7 ported SAPIs and extensions

2015-02-02 Thread Anatol Belski
Hi, properly after the voting phase the https://wiki.php.net/rfc/removal_of_dead_sapis_and_exts moves to the voting. Each item is voted separately. The voting ends on 2015-02-09 at 21:00 CET. Regards Anatol -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit:

Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2

2015-02-02 Thread Andrea Faulds
Hi Dmitry, On 2 Feb 2015, at 18:22, Dmitry Stogov dmi...@zend.com wrote: So, one of the advantages of strict type hinting is the ability to catch potential errors. For example when we pass 67 to setBody(string $message). Yes, that sort of thing is easily caught by strict type checks.

Re: [PHP-DEV] What do we need strict scalar type hints for?

2015-02-02 Thread Dmitry Stogov
On Mon, Feb 2, 2015 at 9:41 PM, Robert Stoll p...@tutteli.ch wrote: Hi Dimitry, -Ursprüngliche Nachricht- Von: Dmitry Stogov [mailto:dmi...@zend.com] Gesendet: Montag, 2. Februar 2015 10:13 An: PHP Internals; Andrea Faulds; Nikita Popov Betreff: [PHP-DEV] What do we need

Re: [PHP-DEV] [RFC][VOTE] Removal of dead or not yet PHP7 ported SAPIs and extensions

2015-02-02 Thread Nikita Popov
On Mon, Feb 2, 2015 at 8:11 PM, Anatol Belski anatol@belski.net wrote: Hi, properly after the voting phase the https://wiki.php.net/rfc/removal_of_dead_sapis_and_exts moves to the voting. Each item is voted separately. The voting ends on 2015-02-09 at 21:00 CET. Regards Anatol I

Re: [PHP-DEV] What do we need strict scalar type hints for?

2015-02-02 Thread Jordi Boggiano
On 02/02/2015 18:56, Stanislav Malyshev wrote: Hi! Keeping that in mind, the declare statement, as ugly as it may look, could be actually a killer to finally get what both camps want but never (and never will) manage to agree. I think having two conceptual frameworks in one language and

Re: [PHP-DEV] [RFC][VOTE] Removal of dead or not yet PHP7 ported SAPIs and extensions

2015-02-02 Thread Lester Caine
On 02/02/15 19:11, Anatol Belski wrote: properly after the voting phase the https://wiki.php.net/rfc/removal_of_dead_sapis_and_exts moves to the voting. Each item is voted separately. The voting ends on 2015-02-09 at 21:00 CET. I feel this is totally out of line since only people who use

Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2

2015-02-02 Thread S.A.N
2015-02-02 21:12 GMT+02:00 Andrea Faulds a...@ajf.me: Hi Dmitry, On 2 Feb 2015, at 18:22, Dmitry Stogov dmi...@zend.com wrote: So, one of the advantages of strict type hinting is the ability to catch potential errors. For example when we pass 67 to setBody(string $message). Yes, that

Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2

2015-02-02 Thread Dmitry Stogov
On Mon, Feb 2, 2015 at 10:12 PM, Andrea Faulds a...@ajf.me wrote: Hi Dmitry, On 2 Feb 2015, at 18:22, Dmitry Stogov dmi...@zend.com wrote: So, one of the advantages of strict type hinting is the ability to catch potential errors. For example when we pass 67 to setBody(string $message).

Re: [PHP-DEV] [RFC][VOTE] Removal of dead or not yet PHP7 ported SAPIs and extensions

2015-02-02 Thread Andrey Andreev
Hi, On Mon, Feb 2, 2015 at 9:15 PM, Nikita Popov nikita@gmail.com wrote: On Mon, Feb 2, 2015 at 8:11 PM, Anatol Belski anatol@belski.net wrote: Hi, properly after the voting phase the https://wiki.php.net/rfc/removal_of_dead_sapis_and_exts moves to the voting. Each item is voted

Re: [PHP-DEV] Re: [DICUSS]Cleanup resource handling APIs

2015-02-02 Thread Sara Golemon
On 2 Feb 2015, at 06:43, Xinchen Hui larue...@php.net wrote: furthermore, I'd like to discuss remove the handle in zend_resource struct.. it may breaks some usage (use resource as long/double/string I've seen uses in the wild where file handles are used as array keys (yes, I know, ugly

[PHP-DEV] 回复: [PHP-DEV] [DICUSS]Cleanup resource handling APIs

2015-02-02 Thread Wei Dai
De : Xinchen Hui [mailto:larue...@php.net] we used to use lval of zval as a handle to access resource type.. but now, we introduced a new type IS_RESOURCE, which make the handle(id) sort of redundant . Wrong. The IS_RESOURCE type has nothing to do with PHP 7. Only

Re: [PHP-DEV] Re: [DICUSS]Cleanup resource handling APIs

2015-02-02 Thread Xinchen Hui
Hey Sara: On Mon, Feb 2, 2015 at 4:01 PM, Sara Golemon p...@golemon.com wrote: On 2 Feb 2015, at 06:43, Xinchen Hui larue...@php.net wrote: furthermore, I'd like to discuss remove the handle in zend_resource struct.. it may breaks some usage (use resource as long/double/string I've seen

Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2

2015-02-02 Thread Andrea Faulds
Hi Dmitry, -- Andrea Faulds http://ajf.me/ On 2 Feb 2015, at 07:02, Dmitry Stogov dmi...@zend.com wrote: As I already told, in my opinion, version 0.1 was the perfect solution that fit into PHP semantic very well. declare(strict_types=1); - is really weird solution. It changes type

Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2

2015-02-02 Thread Andrea Faulds
Hi Dmitry, On 2 Feb 2015, at 07:02, Dmitry Stogov dmi...@zend.com wrote: As I already told, in my opinion, version 0.1 was the perfect solution that fit into PHP semantic very well. I don't like the original. Weak types work to a degree, but they don't fulfill the use case of a lot of

Re: [PHP-DEV] [DICUSS]Cleanup resource handling APIs

2015-02-02 Thread Michael Wallner
On 02 02 2015, at 07:51, François Laupretre franc...@tekwire.net wrote: Sorry to say that, but are you sure you understand the difference between zval types and resource types ? Thanks, you made my day. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit:

Re: [PHP-DEV] [DICUSS]Cleanup resource handling APIs

2015-02-02 Thread Michael Wallner
On 02 02 2015, at 09:01, Sara Golemon p...@golemon.com wrote: On 2 Feb 2015, at 06:43, Xinchen Hui larue...@php.net wrote: furthermore, I'd like to discuss remove the handle in zend_resource struct.. it may breaks some usage (use resource as long/double/string I've seen uses in the

Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2

2015-02-02 Thread Michael Wallner
On 02 02 2015, at 00:49, Andrea Faulds a...@ajf.me wrote: Good evening, The RFC has been updated to cover return types, since Levi’s Return Types RFC has passed. The patch is a work in progress: it works, but lacks tests for return types. Version 0.3 of the RFC can be found here:

Re: [PHP-DEV] Magic getter bug tickled by Moodle

2015-02-02 Thread Yasuo Ohgaki
Hi Xinchen, On Sat, Jan 31, 2015 at 7:15 PM, Xinchen Hui larue...@php.net wrote: must be fixed, https://github.com/php/php-src/commit/1a60175e2595a24ebc3b6d80a112d574c6c98f58 Impressive work! It's irrelevant probably. I only get one valgrind leak with TS build now. NTS is fine.

Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2

2015-02-02 Thread Matteo Beccati
On 02/02/2015 09:49, Michael Wallner wrote: On 02 02 2015, at 00:49, Andrea Faulds a...@ajf.me wrote: Good evening, The RFC has been updated to cover return types, since Levi’s Return Types RFC has passed. The patch is a work in progress: it works, but lacks tests for return types.

Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2

2015-02-02 Thread Andrey Andreev
Hi, On Mon, Feb 2, 2015 at 10:41 AM, Andrea Faulds a...@ajf.me wrote: Hi Dmitry, On 2 Feb 2015, at 07:02, Dmitry Stogov dmi...@zend.com wrote: As I already told, in my opinion, version 0.1 was the perfect solution that fit into PHP semantic very well. I don't like the original. Weak types

Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2

2015-02-02 Thread Lester Caine
On 02/02/15 08:53, Matteo Beccati wrote: I think v0.1 had pretty good chances to get accepted, but I’m not so sure about anything that followed. I’m definitely -1 on declare(strict). I agree. I understand that someone might prefer strict typing, but declare() seems so different from

Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2

2015-02-02 Thread Andrea Faulds
Hi Andrey, On 2 Feb 2015, at 08:55, Andrey Andreev n...@devilix.net wrote: Hi, On Mon, Feb 2, 2015 at 10:41 AM, Andrea Faulds a...@ajf.me wrote: Hi Dmitry, On 2 Feb 2015, at 07:02, Dmitry Stogov dmi...@zend.com wrote: As I already told, in my opinion, version 0.1 was the perfect

Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2

2015-02-02 Thread Thomas Bley
what about giving several voting options? yes/no for scalar type hints and yes/no for declare-strict Regards Thomas Michael Wallner schrieb am 2. Feb 2015 09:49: On 02 02 2015, at 00:49, Andrea Faulds a...@ajf.me wrote: Good evening, The RFC has been updated to cover return types,

Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2

2015-02-02 Thread Andrey Andreev
Hi Andrea, On Mon, Feb 2, 2015 at 11:05 AM, Andrea Faulds a...@ajf.me wrote: Hi Andrey, On 2 Feb 2015, at 08:55, Andrey Andreev n...@devilix.net wrote: Hi, On Mon, Feb 2, 2015 at 10:41 AM, Andrea Faulds a...@ajf.me wrote: Hi Dmitry, On 2 Feb 2015, at 07:02, Dmitry Stogov

[PHP-DEV] What do we need strict scalar type hints for?

2015-02-02 Thread Dmitry Stogov
hi, could you please write down few use cases, when strict scalar type hints are really useful. Thanks. Dmitry.

Re: [PHP-DEV] [RFC] Immutable variables and objects

2015-02-02 Thread Lester Caine
On 02/02/15 07:31, Alexander Lisachenko wrote: Agree in that point with you, this can be a good instrument if implemented in PHP. I see a good point in it by using this with interfaces and const modifier for parameters: class Foo { public function bar(const Baz $object); // Require an

Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2

2015-02-02 Thread Dmitry Stogov
On Mon, Feb 2, 2015 at 11:41 AM, Andrea Faulds a...@ajf.me wrote: Hi Dmitry, On 2 Feb 2015, at 07:02, Dmitry Stogov dmi...@zend.com wrote: As I already told, in my opinion, version 0.1 was the perfect solution that fit into PHP semantic very well. I don't like the original. Weak

<    1   2