thecodingmachine / safe

All PHP functions, rewritten to throw exceptions instead of returning false
MIT License
2.34k stars 139 forks source link

xdebug + set_time_limit + Safe => Exception #443

Open josefsabl opened 4 months ago

josefsabl commented 4 months ago

Hello, this objectively is not a fault of Safe but I am wondering if this could/should be solved on Safe's side.

The problem is, that when xdebug extension is enabled. The set_time_limit returns false even if it was successful. Safe\set_time_limit then converts this false into exception that crashes the application.

It is annoying when debugging and I run into this several times a week.

Maybe this weird edge case could be handled and the false from this function could be ignored when xdebug is enabled.

Obviously there is a workaround to temporarily comment out the Safe/set_time_limit calls or not use them at all.

theofidry commented 4 months ago

Shouldn't it be rather reported to Xdebug as a bug?