|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
17 + 39 = ?
Subscribe to this entry?

 [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-2023 The PHP Group
All rights reserved.
Last updated: Sun Jun 04 22:03:38 2023 UTC