On Mon, Apr 5, 2021, 22:51 Marco Pivetta wrote:
>
>
> On Mon, Apr 5, 2021, 19:42 Mike Schinkel wrote:
>
>>
>> > On Apr 5, 2021, at 12:47 PM, Ben Ramsey wrote:
>> >
>> >> On Apr 5, 2021, at 11:40, André Hänsel wrote:
>> >>
>> >> I was wondering... PHP is the only language I know of where you
On Mon, Apr 5, 2021, 19:42 Mike Schinkel wrote:
>
> > On Apr 5, 2021, at 12:47 PM, Ben Ramsey wrote:
> >
> >> On Apr 5, 2021, at 11:40, André Hänsel wrote:
> >>
> >> I was wondering... PHP is the only language I know of where you have to
> >> write `(new Foo())->bar()` instead of
> >> `new
On 05.04.2021 at 19:19, Ben Ramsey wrote:
>> On Apr 5, 2021, at 12:12, Christoph M. Becker wrote:
>>
>> On 05.04.2021 at 18:40, André Hänsel wrote:
>>
>>> I was wondering... PHP is the only language I know of where you have to
>>> write `(new Foo())->bar()` instead of
>>> `new Foo()->bar()`.
Rowan Tommins wrote:
> it was looking for a property $bar, not a method bar(). Working version:
> https://3v4l.org/S9gLf
Oh, right.
> we would need to allow a more restricted version, as discussed on that
> feature request.
Yeah, that would be great. I think it would already cover the by far
Hi!
On 4/5/21 9:40 AM, André Hänsel wrote:
I was wondering... PHP is the only language I know of where you have to
write `(new Foo())->bar()` instead of
`new Foo()->bar()`. This is particularly apparent with the builder pattern:
Enabling something that is syntax error now sounds pretty
On 05/04/2021 20:51, André Hänsel wrote:
Note that in that bug entry the solution was based on the premise that `$obj = new
$foo->bar();` was valid code, which
it isn't. (https://3v4l.org/lpN1T)
Looking at the error message, that code parsed as valid, but failed at
run-time, because it was
Mike Schinkel wrote:
> I had asked Ben what he thought about allowing the following syntax as a
> synonym for `new Foo()`:
>
> Foo::new()
This can already be done in application code, having the language add a synonym
is IMO unnecessary magic and breaks the
principle of the least surprise.
> On Apr 5, 2021, at 1:51 PM, Claude Pache wrote:
>
>> Le 5 avr. 2021 à 19:42, Mike Schinkel a écrit :
>>
>> Foo::new()
>>
>> That would be backward compatible because you currently cannot have a method
>> named `new()`.
>
> Really? The following compiles without hiccup for me:
> Le 5 avr. 2021 à 19:42, Mike Schinkel a écrit :
>
> Foo::new()
>
> That would be backward compatible because you currently cannot have a method
> named `new()`.
Really? The following compiles without hiccup for me: https://3v4l.org/Vb5Sj
—Claude
> On Apr 5, 2021, at 12:47 PM, Ben Ramsey wrote:
>
>> On Apr 5, 2021, at 11:40, André Hänsel wrote:
>>
>> I was wondering... PHP is the only language I know of where you have to
>> write `(new Foo())->bar()` instead of
>> `new Foo()->bar()`. This is particularly apparent with the builder
> On Apr 5, 2021, at 12:12, Christoph M. Becker wrote:
>
> On 05.04.2021 at 18:40, André Hänsel wrote:
>
>> I was wondering... PHP is the only language I know of where you have to
>> write `(new Foo())->bar()` instead of
>> `new Foo()->bar()`. This is particularly apparent with the builder
> On Apr 5, 2021, at 11:40, André Hänsel wrote:
>
> I was wondering... PHP is the only language I know of where you have to
> write `(new Foo())->bar()` instead of
> `new Foo()->bar()`. This is particularly apparent with the builder pattern:
>
> $developer->drink((new
I was wondering... PHP is the only language I know of where you have to
write `(new Foo())->bar()` instead of
`new Foo()->bar()`. This is particularly apparent with the builder pattern:
$developer->drink((new Coffee())->withCream()->withSugar());
$logger->log((new
13 matches
Mail list logo