|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-09-17 15:36 UTC] derick@php.net
[2004-09-28 23:18 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 12:00:01 2025 UTC |
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