[RFC][Post-Discussion]: E_WARNING when using array-index on non valid container
| From: | David Walker | Date: | Thu, 05 Jan 2017 15:44:52 +0000 |
| Subject: | [RFC][Post-Discussion]: E_WARNING when using array-index on non valid container | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-97520@lists.php.net to get a copy of this message | ||
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