Hi all,
2010/6/5 Felipe Pena
> Hi!
>
> 2010/6/4 Stas Malyshev
>
> Hi!
>>
>>
>> function call chaining (f()() if f() returns function), and array
>>> dereferencing (f()[0]) - (Stas)
>>>
>>
>> I did patch for f()() - it's referenced at
>> http://wiki.php.net/rfc/fcallfcall - but not for f()[] -
Sorry for the ambiguity in my original message, and thanks to Tig for
PM-ing me about that.
To clarify, I support the syntax for:
> echo function(var)[0];
and I believe this syntax:
> $tmp = getimagesize('./path/to/image');
> echo $tmp[1];
to be awkward and inconvenient. Furthermore, it feels
Felipe Pena schreef:
> Hi!
>
> 2010/6/4 Stas Malyshev
>
>> Hi!
>>
>>
>> function call chaining (f()() if f() returns function), and array
>>> dereferencing (f()[0]) - (Stas)
>>>
>> I did patch for f()() - it's referenced at
>> http://wiki.php.net/rfc/fcallfcall - but not for f()[] - didn't have
Hi!
2010/6/4 Stas Malyshev
> Hi!
>
>
> function call chaining (f()() if f() returns function), and array
>> dereferencing (f()[0]) - (Stas)
>>
>
> I did patch for f()() - it's referenced at
> http://wiki.php.net/rfc/fcallfcall - but not for f()[] - didn't have time
> for that yet.
>
> It should
I don't understand what is holding PHP back from having this syntax.
Tig said:
The need to assign the trivial variable $tmp first is completely arbitrary.
Is it not a design goal somewhere that languages should allow the greatest
degree of literal expression possible, consistent with existing sy
On 06/04/2010 10:00 AM, Richard Quadling wrote:
On 4 June 2010 08:18, mathieu.suen wrote:
Hi
Why not something more generic.
Someone could think of a ValueNode.
Then it could be use for object, array, any primitive type ...
I will take the ValueNode as a non terminal grammar node.
So fir
On 4 June 2010 08:18, mathieu.suen wrote:
> Hi
>
> Why not something more generic.
> Someone could think of a ValueNode.
>
> Then it could be use for object, array, any primitive type ...
>
> I will take the ValueNode as a non terminal grammar node.
> So first we could do that:
>
> ValueNode->meth
Hi
Why not something more generic.
Someone could think of a ValueNode.
Then it could be use for object, array, any primitive type ...
I will take the ValueNode as a non terminal grammar node.
So first we could do that:
ValueNode->method();
ValueNode::sMethod();
ValueNode[];
foo(ValueNode);
ech
Hi!
function call chaining (f()() if f() returns function), and array
dereferencing (f()[0]) - (Stas)
I did patch for f()() - it's referenced at
http://wiki.php.net/rfc/fcallfcall - but not for f()[] - didn't have
time for that yet.
It should not be too hard to do, one just has to be caref
2010/6/4 Tig :
> On Fri, Jun 4, 2010 at 11:19 AM, Kalle Sommer Nielsen wrote:
> So does this mean array-dereferencing was original declined but still
> a possible for PHP 6?
> That is how I'm reading it, but just want to make sure.
I belive its because when its been proposed countless times on th
Hi,
I've always wondered the same thing too. Would be a nice improvement.
- Jon
On Thu, Jun 3, 2010 at 9:12 PM, Tig wrote:
> Would be at all possible to implement this kind of shortcut?
>
> echo function(var)[0];
>
> For example, to print the height of an image:
> echo getimagesize('./path/t
Hi,
Has anyone attempted a patch for this? Or does anyone have an idea of
the feasibility? Is it technically possible in a good/clean way?
- Jon
On Thu, Jun 3, 2010 at 9:29 PM, Tig wrote:
> On Fri, Jun 4, 2010 at 11:19 AM, Kalle Sommer Nielsen
> wrote:
> > Hi Tig
> >
> > 2010/6/4 Tig :
> >> W
On Fri, Jun 4, 2010 at 11:19 AM, Kalle Sommer Nielsen wrote:
> Hi Tig
>
> 2010/6/4 Tig :
>> Would be at all possible to implement this kind of shortcut?
>
> Its called array-dereferencing and it was proposed countless times,
> including by myself. There is an RFC for this[1] and it was planned on
Hi Tig
2010/6/4 Tig :
> Would be at all possible to implement this kind of shortcut?
Its called array-dereferencing and it was proposed countless times,
including by myself. There is an RFC for this[1] and it was planned on
the old PHP6 todo at the PDT[2].
[1] http://wiki.php.net/rfc/functionarr
Would be at all possible to implement this kind of shortcut?
echo function(var)[0];
For example, to print the height of an image:
Sure, if you want more than one of the returned array points, this
would not be very efficient, however when you do only need one, it
would be a lot nicer than:
A
15 matches
Mail list logo