|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30134 Reflection cause segmentation fault
Submitted: 2004-09-17 15:06 UTC Modified: 2004-09-28 23:18 UTC
From: dankab at infinito dot it Assigned:
Status: No Feedback Package: Class/Object related
PHP Version: 5.0.1 OS: linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2004-09-17 15:06 UTC] dankab at infinito dot it
[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	{
		catch(Exception $e)	{
			throw $e;
	public function test() {
		if(0!=1) throw new Exception("ERROR",100);

class B extends A { 
	function __construct() {
		try	{
		catch(Exception $e)	{
			throw $e;	

	$class_name = "B";
	$class = new ReflectionClass($class_name);
	if ($class->isInstantiable()) 
		$myInstance = $class->newInstance();
catch(Exception $ex)
	echo $ex->getMessage();

Expected result:
printing of:

Actual result:
segmentation fault in apache 2


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-17 15:36 UTC]
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

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-28 23:18 UTC]
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.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Feb 29 13:01:32 2024 UTC