Re: [PHP-DEV] Re: Improving PHP's type system

2016-04-16 Thread Davey Shafik
On Sat, Apr 16, 2016 at 5:06 PM, Ryan Pallas wrote: > On Sat, Apr 16, 2016 at 4:10 AM, Bastian Schneider < > bastian.schnei...@commerce-plus.com> wrote: > > > > > Just a quick thought. I would prefer something like > > > > union Iterable { > > use array; > > use ArrayAccess; >

Re: [PHP-DEV] Re: Improving PHP's type system

2016-04-16 Thread Ryan Pallas
On Sat, Apr 16, 2016 at 4:10 AM, Bastian Schneider < bastian.schnei...@commerce-plus.com> wrote: > > Just a quick thought. I would prefer something like > > union Iterable { > use array; > use ArrayAccess; > use Traversable; > } > > function bla(Iterable $iterab

Re: [PHP-DEV] Re: Improving PHP's type system

2016-04-16 Thread Bastian Schneider
Just a quick thought. union Iterable { use array; use ArrayAccess; use Traversable; } function bla(Iterable $iterable) { foreach($iterable as $element) {} } Primitives like string, float, bool or int are not allowed in union. Only classes, interf

Re: [PHP-DEV] Re: Improving PHP's type system

2016-04-16 Thread Tom Worster
On 4/16/16 5:04 AM, Tony Marston wrote: "Marco Pivetta" wrote in message news:CADyq6sJfPYgQvhQt=uvcbqkoojjoupcz1sufzwxc+55hl0p...@mail.gmail.com... Tony, that sounds really like "real programmers use `dd -if -of`". Please stop with that argument, as it really doesn't reflect reality. That is

Re: [PHP-DEV] [RFC] Union Types

2016-04-16 Thread Björn Larsson
Den 2016-04-14 kl. 16:25, skrev Levi Morrison: On Thu, Apr 14, 2016 at 3:12 AM, Derick Rethans wrote: On Wed, 13 Apr 2016, Levi Morrison wrote: As alluded to in an earlier email today[1] I am now moving the Union Types RFC[2] to the discussion phase. The short summary of the RFC is that it pe

Re: [PHP-DEV] [RFC] Nullable Types

2016-04-16 Thread Björn Larsson
Den 2016-04-15 kl. 19:58, skrev Dmitry Stogov: A week ago, I actually wrote my own RFC https://wiki.php.net/rfc/nullable_return_types but didn't push it for discussion in favor of Levi's nullable_type RFC (they are almost the same). I'm sure, union types bring too many conceptual and implemen

Re: [PHP-DEV] Re: Improving PHP's type system

2016-04-16 Thread Fleshgrinder
On 4/14/2016 9:59 PM, Stanislav Malyshev wrote: > Hi! > >>> Reduce assertions*, enhance self-documentation, making code more robust, >>> perform checks in the VM and not in userland, ... > > You don't reduce assertions, you just make them more cryptic and change > error message slightly. > e.g.

Re: [PHP-DEV] Re: Improving PHP's type system

2016-04-16 Thread Bastian Schneider
Just a quick thought. I would prefer something like union Iterable { use array; use ArrayAccess; use Traversable; } function bla(Iterable $iterable) { foreach($iterable as $element) {} } Primitives like string, float, bool or int are not allowed

Re: [PHP-DEV] [RFC] Nullable Types

2016-04-16 Thread Lester Caine
On 14/04/16 04:42, Levi Morrison wrote: > There are precedents in several languages for each position. Some > relevant issues to where the question mark goes are noted in the > RFC[3]. Another discussion reference ... http://www.firebirdsql.org/manual/nullguide.html http://www.firebirdsql.org/man

Re: [PHP-DEV] Final properties

2016-04-16 Thread Lester Caine
On 16/04/16 06:56, André Rømcke wrote: >> > This actually summarises many of the problems all of these 'extras' are >> > creating for very little gain. >> > >> > 'Seconds' is a 'Traditional Property' so is untyped and if accessed as a >> > value from some OS's will be a floating point number[...]

Re: [PHP-DEV] Re: Improving PHP's type system

2016-04-16 Thread Tony Marston
"Marco Pivetta" wrote in message news:CADyq6sJfPYgQvhQt=uvcbqkoojjoupcz1sufzwxc+55hl0p...@mail.gmail.com... Tony, that sounds really like "real programmers use `dd -if -of`". Please stop with that argument, as it really doesn't reflect reality. That is not what I said. As a follower of the KI