News for hackers. Stuff that matters.
Re:PHP 8 by matt_kantor on Thursday November 26, 2020 @02:02PM (#25222701)
> it's really int + array or string + file_descriptor, things like that

I haven't personally used PHP in years, but was curious about this. Based on some quick/dumb experiments it appears int + array has thrown errors as far back as PHP4:

- http://sandbox.onlinephpfunctions.com/code/0b2f22ea881b36e58...

- http://sandbox.onlinephpfunctions.com/code/0e5fb752fc3ec28e8...

Is the post talking about some other scenario? Maybe the new thing is that it's now specifically a TypeError?

Re:PHP 8 by hakre on Thursday November 26, 2020 @04:18PM (#25223592)
Yes, was warning / log previously, now it throws. So what was a warning and just going on is now an exception that interrupts.
Re:PHP 8 by Denvercoder9 on Thursday November 26, 2020 @04:03PM (#25223506)
int + array has indeed been throwing errors for a while for the basic arithmetic operations, but not for slightly more complex operations such as modulo, and there are plenty more weird combinations that used to work:

https://3v4l.org/IuoGO