S
S
Sandr-02019-11-03 23:58:42
PHP
Sandr-0, 2019-11-03 23:58:42

When are exceptions thrown in php?

Will php exceptions only occur if throw new Exception is written somewhere in the code, or can standard php functions and classes also throw an exception?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Gomonov, 2019-11-04
@Sandr-0

In your code, even without throw, an exception can be thrown in case of an error. A simple example - at some point, division by 0 will occur. Standard functions and classes can also throw exceptions - if there are any, it is written about it in the office. documentation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question