How to get Notice / Warning as object in PHP?

I'm using PHP 7.3. I'm curious if it is possible to get PHP'sNotice
orWarning
as an object (raised by PHP itself and not by user)? I would appreciate any examples including PHP manual references or code snippets from PHP's internals.
Note: I'm not asking aboutset_error_handler
function which can catch warnings and notices but sadly not as a full objects (https://www.php.net/manual/en/function.set-error-handler.php). I don't want to generate my ownNotice
/Warning
objects withtrigger_error
as it mentioned here: Is there any way to show, or throw, a PHP warning?.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: illegal string offset
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.