|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-06-26 11:26 UTC] bugs dot php at mohiva dot com
Description:
------------
If you pass a previous exception to the constructor of the RuntimeException class, then PHP throws a fatal error without an error message. I have tested those exceptions which are derived from RuntimeException, and they all work fine. The same counts for the base Exception class.
Test script:
---------------
<?php
throw new RuntimeException("Exception message", 0, new Exception());
Expected result:
----------------
Fatal error: Uncaught exception 'RuntimeException' ... on line 3
Actual result:
--------------
Fatal error: in exception.php on line 3
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 21:00:02 2025 UTC |
<?php strpos(); // trigger error throw new \Exception('foo'); // as expected ?> vs. <?php strpos(); // trigger_error throw new \RuntimeException('foo'); // fatal error ?>Never mind.. the \RuntimeException class just doesn't work with APC enabled. <?php throw new \RuntimeException('foo'); // fatal error