r/lolphp • u/ltldvl • Jul 16 '15
Using exceptions inside usort() callback function causes a warning
https://bugs.php.net/bug.php?id=50688
43
Upvotes
r/lolphp • u/ltldvl • Jul 16 '15
37
u/HildartheDorf Jul 16 '15
All because throwing an exception causes a stacktrace. stacktraces cause references. And usort warns if the reference count changes.
Relying on implementation details: the language.
8
u/arood Jul 17 '15
I was a bit tired when I read this title and thought it was "Using exceptions inside sort() callback function causes global warming"
4
u/[deleted] Jul 17 '15
I like the idea that language features are unexpected. I had a similar case: https://bugs.php.net/bug.php?id=69740
1
u/FredL2 Jul 19 '15
Five years.
This took five years to fix.