Re: [PHP-DEV] [DISCUSSION] Match expression

2020-04-23 Thread HubertNNN
Hi! I'm not quite sure what the way forward regarding that is. I can understand the reluctance to propose the Rust-style block expression syntax, given its Speaking of which, what is the problem with that? I mean, if we just declare that the value of a block is the return of the last expres

Re: [PHP-DEV] Any interest in a list type?

2020-04-23 Thread Stephen Reay
> On 23 Apr 2020, at 23:05, Larry Garfield wrote: > > On Thu, Apr 23, 2020, at 12:02 AM, Matthew Brown wrote: >>> This is the *design* process for a language, and it's important... >> Stepping back to reconsider how collections work generally, and how we can >> improve them in a graceful way t

[PHP-DEV] Resolve fallback-to-root-namespace in preloaded implementations

2020-04-23 Thread Nicolas Grekas
Hello, with preloading and Composer, we don't need anymore to consider autoloading for functions and/or constants. The reason is that basically Composer is already doing a great job at loading functions: just give it a list of files and it will ensure they are included all the time. Actually, Comp

Re: [PHP-DEV] [RFC] Mixed type

2020-04-23 Thread Ilija Tovilo
Sorry, I don't know what's wrong with my mail client, it just sent the email with no content. Here's it again. Hi Dan > Here is an RFC for adding a 'mixed' type to the language: > https://wiki.php.net/rfc/mixed_type_v2 > The RFC builds on an earlier draft by Michael Moravec. I don't have a whole

Re: [PHP-DEV] [RFC] Mixed type

2020-04-23 Thread Ilija Tovilo

Re: [PHP-DEV] [RFC] Mixed type

2020-04-23 Thread Gabriel Caruso
On Mon, 20 Apr 2020 at 13:18, Dan Ackroyd wrote: > Hi Internals, > > Here is an RFC for adding a 'mixed' type to the language: > https://wiki.php.net/rfc/mixed_type_v2 > The RFC builds on an earlier draft by Michael Moravec. > > Part of the motivation for pursuing this RFC was my recent experienc

Re: [PHP-DEV] Any interest in a list type?

2020-04-23 Thread Larry Garfield
On Thu, Apr 23, 2020, at 12:02 AM, Matthew Brown wrote: > > This is the *design* process for a language, and it's important... > Stepping back to reconsider how collections work generally, and how we can > improve them in a graceful way that leads to a clean end-state, would be > very valuable. >

[PHP-DEV] Re: [RFC] PHP Namespace Policy

2020-04-23 Thread Mark Randall
On 15/04/2020 12:21, Mark Randall wrote: https://wiki.php.net/rfc/php_namespace_policy Just an update in light of the two different RFCs. Having chatted with the other RFC authors in R11, rather than racing to see who can get their RFC to vote first, it seems like there's room for both. Vo

Re: [PHP-DEV] Any interest in a list type?

2020-04-23 Thread Levi Morrison via internals
On Thu, Apr 23, 2020 at 8:16 AM Matthew Brown wrote: >> >> IIRC, they switched from object semantics to value semantics (like PHP >> arrays). Can someone more knowledgeable confirm? > > > Yes, sorry – Hack introduced the vec type (with value semantics) in 2016 > after they'd experimented first wi

Re: [PHP-DEV] Any interest in a list type?

2020-04-23 Thread Matthew Brown
> > IIRC, they switched from object semantics to value semantics (like PHP > arrays). Can someone more knowledgeable confirm? > Yes, sorry – Hack introduced the vec type (with value semantics) in 2016 after they'd experimented first with Vector (object semantics). Use of Vector is now discouraged.

Re: [PHP-DEV] Re: [DISCUSSION] Match expression

2020-04-23 Thread tyson andre
Hi Ilija, > This is because we don't generate a jumptable when there are less than > 5 integer conditions. Because of this inconsistency I'm not sure if we > should just remove the warning. As you mentioned, it could be > intentional in some cases. Tyson also mentioned that some constants > are pl

Re: [PHP-DEV] [RFC] [DISCUSSION] Ensure correct magic methods' signatures when typed

2020-04-23 Thread Gabriel Caruso
On Thu, 16 Apr 2020 at 18:46, tyson andre wrote: > > Ah, so that's what this is about! In that case, I'd be happy to simply > > always enforce that __construct() cannot return a value, in the same way > we > > do for ": void" functions. (If we have backwards compatibility concerns, > we > > can a

Re: Re: [PHP-DEV] [RFC] Mixed type

2020-04-23 Thread Guilliam Xavier
Hi Christoph and Rowan (your replies kind of overlap), On Thu, Apr 23, 2020 at 12:21 PM Christoph M. Becker wrote: > > On 23.04.2020 at 11:26, Guilliam Xavier wrote: > > > On Wed, Apr 22, 2020 at 11:10 PM Barney Laurance > > wrote: > > > >> Taking a random example, arguments to str_replace docu

Re: [PHP-DEV] Re: [DISCUSSION] Match expression

2020-04-23 Thread Ilija Tovilo
Hi Dan > I don't think PHP can guarantee to detect duplicate conditions This warning is only shown if duplication is guaranteed, namely when a jumptable is generated. Which also makes the check fairly cheap. > Would the duplicate condition* below be detected? No, as jumptables are only generate

Re: [PHP-DEV] [RFC][DISCUSSION] PHP Namespace in core

2020-04-23 Thread G. P. B.
Hello everyone, We've updated the RFC [1] by rewriting it in part and trying to add more details /context and trying to address some other concerns which came up. Hoping for some more feedback before planning on moving this to a vote. Best regards George P. Banyard [1] https://wiki.php.net/rfc

Re: [PHP-DEV] Re: [DISCUSSION] Match expression

2020-04-23 Thread Dan Ackroyd
On Mon, 20 Apr 2020 at 19:20, Ilija Tovilo wrote: > Just a heads up, I'd like to start the voting on the match expression > RFC in a couple of days. > The jury is still out on: > > <*multiple issues> > > If you have anything new to add to the discussion, this is your chance! > On Mon, 20 Apr 202

Re: Re: [PHP-DEV] [RFC] Mixed type

2020-04-23 Thread Rowan Tommins
> On Wed, Apr 22, 2020 at 11:10 PM Barney Laurance wrote ... I don't seem to have this message, and can't find it in any archives; was it sent off-list by mistake? On Thu, 23 Apr 2020 at 10:26, Guilliam Xavier wrote: > Indeed, < > https://www.php.net/manual/en/language.pseudo-types.php#langua

Re: [PHP-DEV] [RFC] Mixed type

2020-04-23 Thread Christoph M. Becker
On 23.04.2020 at 11:26, Guilliam Xavier wrote: > On Wed, Apr 22, 2020 at 11:10 PM Barney Laurance > wrote: > >> Taking a random example, arguments to str_replace documented as mixed >> accept string|array and not anything else. > > Indeed, >

Re: [PHP-DEV] [RFC] Function pipe operator

2020-04-23 Thread Guilliam Xavier
On Wed, Apr 22, 2020 at 11:32 PM Bruce Weirdan wrote: > > Haskell has & operator in Data.Function module which is exact equivalent of > the proposed feature. > Link: > https://hackage.haskell.org/package/base-4.8.0.0/docs/Data-Function.html#g:2 > Example: https://repl.it/repls/KindLightsalmonAppli

Re: Re: [PHP-DEV] [RFC] Mixed type

2020-04-23 Thread Guilliam Xavier
On Wed, Apr 22, 2020 at 11:10 PM Barney Laurance wrote: > > The union of all other types is the top type, but I think as used in phpDoc > mixed is often really a dynamic type, rather than a top type. > > The top type (e.g. Typescript's 'unknown') is the supertype of all other > types, > while the

Re: [PHP-DEV] [VOTE] Type casting in array destructuring expressions

2020-04-23 Thread Enno Woortmann
Am 09.04.2020 um 11:41 schrieb Enno Woortmann: Hi together, I have opened the voting for adding type casting in array destructuring expressions: https://wiki.php.net/rfc/typecast_array_desctructuring As the future scopes section of this proposal includes additional possible topics (eg. stric

[PHP-DEV] [RFC] [VOTE] Locale-independent float to string cast

2020-04-23 Thread Máté Kocsis
Hi Internals, We have just opened the vote on the Locale-independent float to string cast RFC. The voting will be open for two weeks, until 2020-05-07 12:00 UTC. Link: https://wiki.php.net/rfc/locale_independent_float_to_string Cheers, Máté