On Tue, January 19, 2010 10:20 am, Eddie Drapkin wrote:
> On Tue, Jan 19, 2010 at 11:05 AM, Stanislav Malyshev
> wrote:
>> The second was next on my list, while the first seems to me kind of
>> exotic -
>> why create object only to call one method and immediately drop it?
>> Why this
>> method is
>> I also think that:
>> $foo = (new bar())->someSetter();
>
> someSetter() could return $this, although unlikely. The result of the line
> above would be that the bar object is garbage collected after being created
> & method someSetter() invoked. To keep it one would have to do:
In very ra
On Wed, Jan 20, 2010 at 01:05:14PM +0100, Christian Grobmeier wrote:
> On Wed, Jan 20, 2010 at 11:35 AM, Christian Grobmeier
> wrote:
> >>> Why would this imply "dropping" the object?
> >>>
> >>> This:
> >>> $foo = (new bar())->someSetter();
> >>> Looks a lot better than this
> >>> $foo = ne
On Wed, Jan 20, 2010 at 11:35 AM, Christian Grobmeier
wrote:
>>> Why would this imply "dropping" the object?
>>>
>>> This:
>>> $foo = (new bar())->someSetter();
>>> Looks a lot better than this
>>> $foo = new bar();
>>> $foo->someSetter();
>>
>> The second version is much clearer. You kn
Hi!
When I use one, I consider it exotic/obtuse/unusual enough to require
self-documenting code, with a temp variable whose name include
'closure'.
By "use" I meant not "use it so rarely that it's an exotic hack for me
that I have to explain what I did here", I mean "write code that relies
o
On Tue, January 19, 2010 10:05 am, Stanislav Malyshev wrote:
> Hi!
>
>> I'd rather see two other things that are missing, support for
>> dynamic object and array de-referencing like
>> (new class)->method() and get_array()["index"].
>
> The second was next on my list, while the first seems to me ki
Eddie Drapkin wrote:
> On Tue, Jan 19, 2010 at 12:02 PM, Rasmus Lerdorf wrote:
>> Eddie Drapkin wrote:
>>> On Tue, Jan 19, 2010 at 11:05 AM, Stanislav Malyshev wrote:
The second was next on my list, while the first seems to me kind of exotic
-
why create object only to call one me
On Tue, Jan 19, 2010 at 12:02 PM, Rasmus Lerdorf wrote:
> Eddie Drapkin wrote:
>> On Tue, Jan 19, 2010 at 11:05 AM, Stanislav Malyshev wrote:
>>> The second was next on my list, while the first seems to me kind of exotic -
>>> why create object only to call one method and immediately drop it? Why
Eddie Drapkin wrote:
> On Tue, Jan 19, 2010 at 11:05 AM, Stanislav Malyshev wrote:
>> The second was next on my list, while the first seems to me kind of exotic -
>> why create object only to call one method and immediately drop it? Why this
>> method is not static then?
>
>
> Why would this imp
On Tue, Jan 19, 2010 at 11:05 AM, Stanislav Malyshev wrote:
> The second was next on my list, while the first seems to me kind of exotic -
> why create object only to call one method and immediately drop it? Why this
> method is not static then?
Why would this imply "dropping" the object?
This:
Hi!
I'd rather see two other things that are missing, support for
dynamic object and array de-referencing like
(new class)->method() and get_array()["index"].
The second was next on my list, while the first seems to me kind of
exotic - why create object only to call one method and immediately
Hi,
On Tue, 2010-01-19 at 12:31 +0100, Michael Wallner wrote:
> On 01/19/2010 01:27 AM, Stanislav Malyshev wrote:
> > Hi!
> >
> > I wrote a small patch that enables this kind of syntax in PHP:
> >
> > foo()();
I think that becomes hard to read quite easily.
> I'd rather see two other things th
2010/1/19 Pierre Joye :
> On Tue, Jan 19, 2010 at 12:31 PM, Michael Wallner wrote:
>> On 01/19/2010 01:27 AM, Stanislav Malyshev wrote:
>>> Hi!
>>>
>>> I wrote a small patch that enables this kind of syntax in PHP:
>>>
>>> foo()();
>>
>> I'd rather see two other things that are missing, support fo
On Tue, Jan 19, 2010 at 12:31 PM, Michael Wallner wrote:
> On 01/19/2010 01:27 AM, Stanislav Malyshev wrote:
>> Hi!
>>
>> I wrote a small patch that enables this kind of syntax in PHP:
>>
>> foo()();
>
> I'd rather see two other things that are missing, support for
> dynamic object and array de-re
14 matches
Mail list logo