Php exceeds execution time when throwing exception to recursion

Edit: rewritten from scratch, old question was not useful

I got an error after throwing an exception from recursion. The exception is not caught anywhere, it should just appear and show uncaught exception errorwhat is not. Instead, it creates an error time limit hit. If I put var_dumps in my code, it looks like the exception is thrown, but then it just hangs and fails after it exceeds the limit.

this is part of the recursive function:

if($this->prvky[$iA]->ini < 1 || $this->prvky[$iB]->ini < 1){
    echo '--- THROWING ---';
    throw new \OutOfBoundsException('ini is smaller than 1');
}

It works fine in tests, an exception can be thrown, and if so, it will succeed with an error uncaught exception.

In mode, it works fine in the real world when an exception is not thrown.

But when the condition goes into the real world and an exception is thrown, it --- THROWING ---is printed, followed by uncaught exception, but instead, it goes crazy and does not work after a while, producing an error time limit exceeded. I know for sure that an exception is thrown, and I know for sure that I see no exception anywhere.

0
source share
1 answer

The real problem was a combination of error out of memory, which, unfortunately, did not appear , crazy settings in xdebug and object connectivity producing a lot of data.

- , , , :

xdebug.var_display_max_depth = -1
xdebug.var_display_max_children = -1
xdebug.var_display_max_data = -1

xdebug . , , .., ( ) . , xdebug, , , xdebug , . (, )

out of time out of memory. , (2 ) , . , , , , , , .

+3

Source: https://habr.com/ru/post/1532963/


All Articles