Hi all,
On Fri, Jan 30, 2015 at 8:51 AM, Rasmus Lerdorf wrote:
> On 01/29/2015 01:32 PM, Yasuo Ohgaki wrote:
> > Hi all,
> >
> > I came across with bug #68947 https://bugs.php.net/bug.php?id=68947
> > and realized small inconsistency.
> >
> > http://3v4l.org/ldZKl
> >
> > $obj->${array[$key]}; /
On 01/29/2015 01:32 PM, Yasuo Ohgaki wrote:
> Hi all,
>
> I came across with bug #68947 https://bugs.php.net/bug.php?id=68947
> and realized small inconsistency.
>
> http://3v4l.org/ldZKl
>
> $obj->${array[$key]}; // Syntax error
> $obj->{$array[$key]}; // Works
>
> $obj->${key}; // E_NOTICE. D
Hi,
On Fri, Jan 30, 2015 at 12:49 AM, Yasuo Ohgaki wrote:
> Hi Andrea,
>
> On Fri, Jan 30, 2015 at 7:17 AM, Andrea Faulds wrote:
>>
>> I would expect that anything within ${} works the same as it does outside
>> it. Having $obj->${array[$key]} do something different to $key =
>> array[$key], $ob
Hi Andrea,
On Fri, Jan 30, 2015 at 7:17 AM, Andrea Faulds wrote:
> I would expect that anything within ${} works the same as it does outside
> it. Having $obj->${array[$key]} do something different to $key =
> array[$key], $obj->${$key} would make no sense to me.
Good point! I forgot about var
Hi Yasuo,
> On 29 Jan 2015, at 22:14, Yasuo Ohgaki wrote:
>
> Hi Andrey,
>
> On Fri, Jan 30, 2015 at 6:43 AM, Andrey Andreev wrote:
>>
>> Is somebody actually recommending the latter form? I'm surprised that
>> it even works ... that should be a syntax error IMO.
>
>
> Do you mean
>
> echo
Hi Andrey,
On Fri, Jan 30, 2015 at 6:43 AM, Andrey Andreev wrote:
>
> Is somebody actually recommending the latter form? I'm surprised that
> it even works ... that should be a syntax error IMO.
Do you mean
echo "${array[$key]}"; // Works
should be errror?
This form is common in shell scripti
Hi,
On Thu, Jan 29, 2015 at 11:32 PM, Yasuo Ohgaki wrote:
> Hi all,
>
> I came across with bug #68947 https://bugs.php.net/bug.php?id=68947
> and realized small inconsistency.
>
> http://3v4l.org/ldZKl
>
> $obj->${array[$key]}; // Syntax error
> $obj->{$array[$key]}; // Works
>
> $obj->${key}; //
Hi all,
I came across with bug #68947 https://bugs.php.net/bug.php?id=68947
and realized small inconsistency.
http://3v4l.org/ldZKl
$obj->${array[$key]}; // Syntax error
$obj->{$array[$key]}; // Works
$obj->${key}; // E_NOTICE. Does not work
$obj->{$key}; // Works
echo "${array[$key]}"; // Wor