<?php class GrandParentWithConstructor { function __construct() {} } class ParentWithConstructor extends GrandParentWithConstructor { function __construct() {} } class ChildWithoutConstructor extends ParentWithConstructor {} $refl = new ReflectionMethod('ParentWithConstructor', '__construct'); try { $refl->getPrototype(); } catch (\ReflectionException $e) { var_dump(substr(strstr($e->getMessage(), "::__construct", 1), 7)); } $refl = new ReflectionMethod('ChildWithoutConstructor', '__construct'); try { $refl->getPrototype(); } catch (\ReflectionException $e) { var_dump(substr(strstr($e->getMessage(), "::__construct", 1), 7)); }
You have javascript disabled. You will not be able to edit any code.