From: seld Operating system: Windows 7, x64 PHP version: 5.4SVN-2011-07-11 (snap) Package: SPL related Bug Type: Bug Bug description:SplFileInfo throws a LogicException saying it's constructor has to be called
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 bug report at https://bugs.php.net/bug.php?id=55175&edit=1 -- Try a snapshot (PHP 5.2): https://bugs.php.net/fix.php?id=55175&r=trysnapshot52 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55175&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55175&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=55175&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55175&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=55175&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=55175&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=55175&r=needscript Try newer version: https://bugs.php.net/fix.php?id=55175&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=55175&r=support Expected behavior: https://bugs.php.net/fix.php?id=55175&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=55175&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=55175&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=55175&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55175&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=55175&r=dst IIS Stability: https://bugs.php.net/fix.php?id=55175&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=55175&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=55175&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=55175&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=55175&r=mysqlcfg Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55175&r=trysnapshot54