Re: [PHP-DEV] [RFC][Under discussion] Arbitrary string interpolation

2022-03-18 Thread Theodore Brown
On Fri, Mar 18, 2022 at 09:02 Chase Peeler wrote: > On Fri, Mar 18, 2022 at 12:49 AM Theodore Brown > wrote: > > > > Personally I'm really looking forward to having this functionality. > > Just a couple days ago I wanted to call a function in an interpolated > > string, and it was really

Re: [PHP-DEV] [RFC][Under discussion] Arbitrary string interpolation

2022-03-18 Thread Hans Henrik Bergan
i'd write it as $name = "Theodore Brown"; echo "{$name} has a length of " . strlen ( $name ) . "."; On Fri, 18 Mar 2022 at 05:49, Theodore Brown wrote: > On Thu, Mar 17, 2022 at 5:40 PM Tobias Nyholm > wrote: > > > On Thu, 17 Mar 2022, 23:27 Ilija Tovilo, wrote: > > > >> Hi everyone > >> > >>

Re: [PHP-DEV] [RFC][Under discussion] Arbitrary string interpolation

2022-03-18 Thread Claude Pache
> Le 18 mars 2022 à 18:49, Paul Dragoonis a écrit : > > I think the original goal of this RFC is to make PHP more expressive, and > less clunky (look at Jav). This is a good goal and one much desired by the > community, but I think the approach here isn't the right fit or way to > achieve it

Re: [PHP-DEV] [RFC][Under discussion] Arbitrary string interpolation

2022-03-18 Thread Paul Dragoonis
I think the original goal of this RFC is to make PHP more expressive, and less clunky (look at Jav). This is a good goal and one much desired by the community, but I think the approach here isn't the right fit or way to achieve it Writing code in strings is a DX nightmare, and static analysis

[PHP-DEV] Re: Deprecated partially supported callables: should is_callable() throwa deprecation notice ?

2022-03-18 Thread Juliette Reinders Folmer
On 18-3-2022 14:37, Christoph M. Becker wrote: On 16.03.2022 at 06:52, Juliette Reinders Folmer wrote: I've just been looking in detail at the Partially Supported Callables deprecation RFC: https://wiki.php.net/rfc/deprecate_partially_supported_callables The RFC explicitly excludes the

Re: [PHP-DEV] [RFC][Under discussion] Arbitrary string interpolation

2022-03-18 Thread Pierre
Le 18/03/2022 à 15:02, Chase Peeler a écrit : On Fri, Mar 18, 2022 at 12:49 AM Theodore Brown wrote: On Thu, Mar 17, 2022 at 5:40 PM Tobias Nyholm wrote: On Thu, 17 Mar 2022, 23:27 Ilija Tovilo, wrote: Hi everyone I'd like to start discussion on a new RFC for arbitrary string

Re: [PHP-DEV] [RFC][Under discussion] Arbitrary string interpolation

2022-03-18 Thread Chase Peeler
On Fri, Mar 18, 2022 at 12:49 AM Theodore Brown wrote: > On Thu, Mar 17, 2022 at 5:40 PM Tobias Nyholm > wrote: > > > On Thu, 17 Mar 2022, 23:27 Ilija Tovilo, wrote: > > > >> Hi everyone > >> > >> I'd like to start discussion on a new RFC for arbitrary string > >> interpolation. > >>

[PHP-DEV] Re: Deprecated partially supported callables: should is_callable() throwa deprecation notice ?

2022-03-18 Thread Christoph M. Becker
On 16.03.2022 at 06:52, Juliette Reinders Folmer wrote: > I've just been looking in detail at the Partially Supported Callables > deprecation RFC: > https://wiki.php.net/rfc/deprecate_partially_supported_callables > > The RFC explicitly excludes the `is_callable()` function and the > `callable`

Re: [PHP-DEV] Convert return to expression like throw

2022-03-18 Thread Rowan Tommins
On 18/03/2022 10:18, Florian Stascheck wrote: function getUnreadDocuments(): int { $documents = Auth::user()?->getDocuments() ?? return 0; // actual logic of the function return 42; } I think I'd probably reject that example as too cryptic in a code review; the mixture of assignment and

[PHP-DEV] Convert return to expression like throw

2022-03-18 Thread Florian Stascheck
Hello, We remember the old days, when we had to do: function getUnreadDocuments(): int { $user = Auth::user(); if (is_null($user)) return 0; $documents = $user->getDocuments(); if (is_null($documents)) return 0; // actual logic of the function return 42; } And it was already really nice to do:

Re: [PHP-DEV] [RFC][Under discussion] Arbitrary string interpolation

2022-03-18 Thread Robert Landers
I've wanted this for years! Robert Landers Software Engineer Utrecht NL On Thu, Mar 17, 2022 at 11:27 PM Ilija Tovilo wrote: > Hi everyone > > I'd like to start discussion on a new RFC for arbitrary string > interpolation. > https://wiki.php.net/rfc/arbitrary_string_interpolation > > Let me