Re: 7.2 behavior break, Bug #74836 isset on zero-prefixed numeric indexes in array broken

From: Date: Tue, 04 Jul 2017 00:23:27 +0000
Subject: Re: 7.2 behavior break, Bug #74836 isset on zero-prefixed numeric indexes in array broken
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-99729@lists.php.net to get a copy of this message
Hi! > > Please take a look at https://bugs.php.net/bug.php?id=74836 > > What is the best option to fix this? > > > The most consistent way, from my point of view - disabling zero-prefexed numeric strings in all > cases, but this is a new behavior break. I think this is very corner case, for string offsets. So for 7.2 to drop support for leading-0 string, with note in UPGRADING and maybe a notice/warning, would be ok. It is not good though that read access and isset are not consistent, this should always work the same. It is especially worrying that "010" and $i = "010" work differently, that should never happen. The problem is if we disable it for string offsets, it would be weird to keep it for array offsets, and so for arrays "010" should be treated as string I guess? Which may involve more breakage. So I wonder if a better way would be to just let it be as it always was, and maybe make leading-0 strings not to be interpreted as numbers for both cases in PHP.next when we can do BC breaks. -- Stas Malyshev smalyshev@gmail.com

« previous php.internals (#99729) next »