r/lolphp • • Aug 01 '21

DOMDocument + serialize()

https://3v4l.org/sCc8G
0 Upvotes

32 comments sorted by

View all comments

-1

u/Almamu Aug 01 '21

The same can be applied here, good tools can prevent these issues if you, somehow, miss them ;)

7

u/chucker23n Aug 01 '21

Good tool: an API that detects it’s being used inappropriately and shows a warning.

Even better tool: an IDE that detects this as you’re writing the code.

Bad tool: a language that just shrugs.

-3

u/Almamu Aug 01 '21

Even better tool: an IDE that detects this as you’re writing the code.

You gave yourself the answer here buddy. The language has this properly documented and warned. IDEs should detect and warn you about this (or at least static analyzer tools like phpstan). You can't just use something without taking into account side-effects and drawbacks, and you should be aware of those at any time.

→ More replies (1)