#30134 [Fbk->NoF]: Reflection cause segmentation fault
| From: | sniper@php.net | Date: | Tue, 28 Sep 2004 21:19:21 +0000 |
| Subject: | #30134 [Fbk->NoF]: Reflection cause segmentation fault | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-66834@lists.php.net to get a copy of this message | ||
ID: 30134
Updated by: sniper@php.net
Reported By: dankab at infinito dot it
-Status: Feedback
+Status: No Feedback
Bug Type: Class/Object related
Operating System: linux
PHP Version: 5.0.1
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2004-09-17 15:36:23] derick@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php
Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
------------------------------------------------------------------------
[2004-09-17 15:06:56] dankab at infinito dot it
Description:
------------
[sorry for my english]
the ReflectionClass cause a segmentation fault if the constructor of a
class, calling his parent constructor, throws an exception
if i use the syntax:
$myInstance = new $class_name();
all is ok
Reproduce code:
---------------
class A {
function __construct() {
try {
$this->test();
}
catch(Exception $e) {
throw $e;
}
}
public function test() {
if(0!=1) throw new Exception("ERROR",100);
}
}
class B extends A {
function __construct() {
try {
parent::__construct();
}
catch(Exception $e) {
throw $e;
}
}
}
try
{
$class_name = "B";
$class = new ReflectionClass($class_name);
if ($class->isInstantiable())
$myInstance = $class->newInstance();
}
catch(Exception $ex)
{
echo $ex->getMessage();
}
Expected result:
----------------
printing of:
ERROR
Actual result:
--------------
segmentation fault in apache 2
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30134&edit=1