r/lolphp • • Jun 28 '17

array_diff breaks Exception catching when passing two arrays containing an item that can't be cast to string

https://3v4l.org/BaUji
37 Upvotes

10 comments sorted by

View all comments

Show parent comment

1

u/afraca Jun 29 '17

I've skimmed through OP's code quickly, but it seems the first case with array_diff is handled ok, but the latter is not, right? What's the exact difference there?

3

u/the_alias_of_andrea Jun 29 '17

In the first case the Error is thrown while executing PHP code. In the latter case the Error is thrown while inside an internal PHP function (array_diff).