Edit report at https://bugs.php.net/bug.php?id=55175&edit=1
ID: 55175 Updated by: sala...@php.net Reported by: s...@php.net Summary: SplFileInfo throws a LogicException saying it's constructor has to be called Status: Open Type: Bug Package: SPL related -Operating System: Windows 7, x64 +Operating System: PHP Version: 5.4SVN-2011-07-11 (snap) -Assigned To: +Assigned To: cataphract Block user comment: N Private report: N New Comment: Related to #54384 Previous Comments: ------------------------------------------------------------------------ [2011-07-11 07:09:04] s...@php.net Description: ------------ SplFileInfo throws the following exception whenever you extend it: LogicException: In the constructor of ExtendingClass, parent::__construct() must be called and its exceptions cannot be cleared Note that, in the example below, defining the constructor explicitly and calling parent::__construct() does not fix the issue. Test script: --------------- # php -r 'class Foo extends SplFileInfo {} new SplFileInfo("foo"); new Foo("bar ");' Expected result: ---------------- No output Actual result: -------------- Fatal error: Uncaught exception 'LogicException' with message 'In the constructor of Foo, parent::__construct() must be called and its exceptions cannot be cleared' in Command line code:1 Stack trace: #0 Command line code(1): Foo->internal_construction_wrapper('bar') #1 {main} thrown in Command line code on line 1 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=55175&edit=1