Bug #55175 [Asn->Csd]: SplFileInfo throws a LogicException saying it's constructor has to be called
| From: | cataphract@php.net | Date: | Sat, 29 Oct 2011 23:18:27 +0000 |
| Subject: | Bug #55175 [Asn->Csd]: 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-164672@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: cataphract@php.net
Reported by: seld@php.net
Summary: SplFileInfo throws a LogicException saying it's
constructor has to be called
-Status: Assigned
+Status: Closed
Type: Bug
Package: SPL related
PHP Version: 5.4SVN-2011-07-11 (snap)
Assigned To: cataphract
Block user comment: N
Private report: N
New Comment:
Replaced with 5.3 code.
Previous Comments:
------------------------------------------------------------------------
[2011-10-29 23:17:15] cataphract@php.net
Automatic comment from SVN on behalf of cataphract
Revision: http://svn.php.net/viewvc/?view=revision&revision=318566
Log: - Reverted changes that required constructor overrides to invoke the parent
constructor in several SPL classes and applied 5.3 fixes instead.
Related bugs: #54384, #55175 and #55300
------------------------------------------------------------------------
[2011-07-11 07:21:13] salathe@php.net
Related to #54384
------------------------------------------------------------------------
[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