Welcome! Log In Create A New Profile

Advanced

[PHP-DEV] [RFC][Post-Discussion]: E_WARNING when using array-index on non valid container

Posted by David Walker 
[Sorry if this is a second time you get this, but email issues and all]

Hi all,

Joe had requested renewed discussion on the accepted RFC[1] and my proposed
PR[2] be brought forward again for implementation discussion, and to come
up with a resolution.

The RFC, though accepted, had concerns with implementation specifically
related to suppression of multiple warnings for nested access of
dim-fetching. I tried to mitigate and resolve the problems raised during
the RFC process by ensuring only to raise for non-list() access, and only
if the op1 of the next opcode is VAR and is the same opcode as the current
one. This seems to suppress all warnings I could think of testing, but am
not sure all potential use-cases of when we attempt to fetch for read. Any
thoughts on a better implementation, or other use cases that need attention
would be appreciated.

Cheers
--
Dave

[1] - wiki [dot] php [dot] net/rfc/notice-for-non-valid-array-container
[2] - github [dot] com/php/php-src/pull/2031
Hi David,

On 11 January 2017 at 15:42, David Walker <[email protected]> wrote:
> Joe had requested renewed discussion on the accepted RFC[1] and my proposed
> PR[2] be brought forward again for implementation discussion, and to come
> up with a resolution.
>
> Any
> thoughts on a better implementation, or other use cases that need attention
> would be appreciated.
>

Please could you give us an update on the status of the
implementation, and are you still looking for advice on how what would
be needed to complete it?

cheers
Dan
Ack

ps for the record, I just spent an hour today trying to figure out why
code equivalent to

$foo = null;
echo $foo['bar']

wasn't triggering an error, so I hope this can make it for 7.2

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Am 31.05.2017 um 18:16 schrieb Dan Ackroyd:
> On 11 January 2017 at 15:42, David Walker <[email protected]> wrote:
>> Joe had requested renewed discussion on the accepted RFC[1] and my proposed
>> PR[2] be brought forward again for implementation discussion, and to come
>> up with a resolution.
>>
>> Any
>> thoughts on a better implementation, or other use cases that need attention
>> would be appreciated.
>
> Please could you give us an update on the status of the
> implementation, and are you still looking for advice on how what would
> be needed to complete it?
>
> ps for the record, I just spent an hour today trying to figure out why
> code equivalent to
>
> $foo = null;
> echo $foo['bar']
>
> wasn't triggering an error, so I hope this can make it for 7.2

because otherwise you couldn't do something like below with a 1-liner
and so that PHP5.4 feature becomes pretty useless because for a isset()
you need to store it in a var

function GetKatMaxSort(): int
{
global $db;
return (int)$db->fetch_row($db->query('select max(hsort) from ' .
sql_prefix . 'haupt', 1, 0))[0];
}

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
On Wed, May 31, 2017 at 10:16 AM Dan Ackroyd <[email protected]> wrote:

> Hi David,
>
> On 11 January 2017 at 15:42, David Walker <[email protected]> wrote:
> > Joe had requested renewed discussion on the accepted RFC[1] and my
> proposed
> > PR[2] be brought forward again for implementation discussion, and to come
> > up with a resolution.
> >
> > Any
> > thoughts on a better implementation, or other use cases that need
> attention
> > would be appreciated.
> >
>
> Please could you give us an update on the status of the
> implementation, and are you still looking for advice on how what would
> be needed to complete it?
>

I had sent out messages on the subject a while back and heard nothing in
response. So I had assumed without more discussion it would have been
merged at some point when prepping for 7.2.

So if there's continued problems, and or issues, I'd be receptive to
hearing about them. However my time to dedicate at it currently is pretty
minimal, having recently taken a new job, most of my free cycles have been
going to read/learn where i'm at now.

cheers
--
Dave
Sorry, only registered users may post in this forum.

Click here to login