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
Hi all,
2010/6/5 Felipe Pena felipe...@gmail.com
Hi!
2010/6/4 Stas Malyshev smalys...@sugarcrm.com
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 -
I don't understand what is holding PHP back from having this syntax.
Tig said:
?
$tmp = getimagesize('./path/to/image');
echo $tmp[1];
?
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
Hi!
2010/6/4 Stas Malyshev smalys...@sugarcrm.com
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.
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);
On 4 June 2010 08:18, mathieu.suen mathieu.s...@easyflirt.com 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:
On 06/04/2010 10:00 AM, Richard Quadling wrote:
On 4 June 2010 08:18, mathieu.suenmathieu.s...@easyflirt.com 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
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/to/image')[1];
?
Sure, if you want more than one of the returned array points, this
would not be very efficient, however when you do
Hi Tig
2010/6/4 Tig tigger...@gmail.com:
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]
On Fri, Jun 4, 2010 at 11:19 AM, Kalle Sommer Nielsen ka...@php.net wrote:
Hi Tig
2010/6/4 Tig tigger...@gmail.com:
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
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 tigger...@gmail.com wrote:
On Fri, Jun 4, 2010 at 11:19 AM, Kalle Sommer Nielsen ka...@php.net
wrote:
Hi Tig
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 tigger...@gmail.com 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
2010/6/4 Tig tigger...@gmail.com:
On Fri, Jun 4, 2010 at 11:19 AM, Kalle Sommer Nielsen ka...@php.net 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
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
14 matches
Mail list logo