<?php
class a
{
public $retorno;
public function test()
{
try {
throw new Exception('Error!');
} catch(Exception $e) {
$this->retorno = 'mensagem!';
}
}
public function __destruct()
{
echo $this->retorno;
}
}
$a = new a;
$a->test();
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
mensagem!