Welcome! Log In Create A New Profile


[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.


[1] - wiki [dot] php [dot] net/rfc/notice-for-non-valid-array-container
[2] - github [dot] com/php/php-src/pull/2031
Sorry, only registered users may post in this forum.

Click here to login