in Laravel i'm trying to use php set_error_handler
method to handel errors by web application and avoid to crash that, unfortunately when i define this code on __constructor()
such as this sample i get this error:
array:4 [▼
"Error no " => 8
"Error String" => "unserialize(): Error at offset 0 of 123 bytes"
"Error File " => "C:\xampp\htdocs\instacheeta\vendor\laravel\framework\src\Illuminate\Auth\Recaller.php" "Error Line" => 24 ]
my code:
public function __construct()
{
set_error_handler([$this, 'customError'], E_ALL);
parent::__construct();
}
function customError($errno, $errstr, $errfile, $errline)
{
dd(
[
'Error no ' => $errno,
'Error String' => $errstr,
'Error File ' => $errfile,
'Error Line' => $errline
]
);
}
it seems problem is using arguments on dd
, when i commented dd
i dont get error
how can i resolve this problem?