3v4l.org

run code in 300+ PHP versions simultaneously
<?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)); }

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
212.71 ms | 2718 KiB | 13 Q