Description
The following code:
<?php
$exception = new Exception('2312');
try {
// throw new Exception('2312'); // this line works OK.
throw new $exception;
} catch (Exception $e){
var_dump(spl_object_id($e));
echo 'Message: '.$e->getMessage();
}
Resulted in this output:
But I expected this output instead:
PHP Seems to clone $exception and not copy message (tested only message)
PHP Version
Operating System
All