2 ms·
> 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
by matt_kantor 6y ago
> 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/0b2f22ea881b36e58b3cee063a5e9d730ec0c11c http://sandbox.onlinephpfunctions.com/code/0b2f22ea881b36e58...
- http://sandbox.onlinephpfunctions.com/code/0e5fb752fc3ec28e89c9e6a0c1e2c4451522a99d 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?
- Denvercoder9 6y agoint + 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 https://3v4l.org/IuoGO
- hakre 6y agoYes, was warning / log previously, now it throws. So what was a warning and just going on is now an exception that interrupts.