<?php class AException extends \Exception {} class T extends \RuntimeException{ public function __construct($message, AException $e) { parent::__construct($message, $e->getCode(), $e); } } try { throw new T("CRAP", new AException); } catch (\Exception $e) { var_dump($e); // It's not of type AException any more }
You have javascript disabled. You will not be able to edit any code.