<?php class MyClassException extends Exception { public function __construct(string $message, public string $className = '') { parent::__construct($message); } } spl_autoload_register(static function ($className) { // Do magic class file loading here. throw new MyClassException('Class not found', $className); }); try { $a = unserialize('O:10:"DummyClass":0:{}'); } catch (MyClassException $e) { $a = null; // Or some other missing class handling } var_dump($a);
You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).