Bug #55175 [Opn]: SplFileInfo throws a LogicException saying it's constructor has to be called

From: Date: Mon, 11 Jul 2011 11:21:13 +0000
Subject: Bug #55175 [Opn]: SplFileInfo throws a LogicException saying it's constructor has to be called
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-161785@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=55175&edit=1 ID: 55175 Updated by: salathe@php.net Reported by: seld@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] seld@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

« previous php.bugs (#161785) next »