Re: Setting to disable the "Undefined array index" warning

From: Date: Tue, 15 Feb 2022 12:46:48 +0000
Subject: Re: Setting to disable the "Undefined array index" warning
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-117037@lists.php.net to get a copy of this message
Hi Nicolas, as far as I understand, adding new ini settings is not the way to go as this would mean that your code behaves differently on different environments. Two suggestions: * Write your own error handler that ignores those errors. * Try some tool like Rector to rewrite your code. Best regards Thomas Am 15.02.22 um 13:31 schrieb Nicolas BADIA:
Hi, As it is explained in this ticket https://bugs.php.net/bug.php?id=81417 we use to check if a property exists by accessing it directly like we do in JavaScript. Personally, I subscribe to this coding style and we use it all over our codebase (more than 130 000 lines of PHP code). When it became a notice, we disabled them, but now that it is a warning, it is a lot more problematic for us… We can’t even use the last version of PHP Debug for VSCode. As I’m not ready to spend weeks upgrading our codebase because our coding style is not supported by the community, I’m looking at alternatives. The more obvious and simple for me would be to add a setting in php.ini to allow this. So I’d like to know if it is something you would support. If not, I guess I will have to fork PHP, but this will complicate a lot our deployment process and make our code not portable. As I believe we are not the same in this case, I hope you will support the addition of a setting… Thanks in advance for considering this. Best regards, Nicolas


« previous php.internals (#117037) next »