[wp-trac] [WordPress Trac] #49143: Deprecated constructor warning in Blogger Importer

WordPress Trac noreply at wordpress.org
Tue Dec 15 09:56:25 UTC 2020


#49143: Deprecated constructor warning in Blogger Importer
--------------------------+----------------------------
 Reporter:  leemon        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  reopened
 Priority:  high          |   Milestone:  WordPress.org
Component:  Import        |     Version:  5.3.2
 Severity:  blocker       |  Resolution:
 Keywords:                |     Focuses:
--------------------------+----------------------------
Changes (by jrf):

 * keywords:  php8 =>


Comment:

 > A similar error is now a fatal in PHP8.

 @iandunn Sorry, but that is a completely unrelated error and should have
 its own ticket.

 A deprecated PHP 4 constructor method is (silently) treated like a
 ''normal'' method in PHP 8 and will not cause a fatal error.

 This issue is talking about this code pattern:
 {{{#!php
 <?php
 class Blogger_Importer {
     function __construct() {}

     function Blogger_Importer() {
         self::__construct();
     }
 }
 }}}

 If the class (still) does not contain a `__construct()` method, the
 `Blogger_Importer()` method should be renamed to `__construct()`.

 Otherwise, unless called directly, the `Blogger_Importer()` method will
 just be an unused method, which can be removed.


 The fatal error mentioned by @iandunn is about one class extending another
 class and overloading an arbitrary method in that class using a different,
 incompatible function signature.
 That will cause a fatal error in PHP 8, but is a completely different
 issue.

 @SergeyBiryukov The base importer code seems to be maintained here:
 https://github.com/WordPress/wordpress-importer/ but that repo doesn't
 appear to contain the code for platform specific importers. Where is that
 code maintained ? In SVN ? Or are there git repos somewhere for these ?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49143#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list