• Alfo

    (@alfonsberger)


    Hi,

    we get a ton of these messages in our debug.log:

    PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; LoginWithAjaxAdmin has a deprecated constructor in /xxxx/wp-content/plugins/login-with-ajax/login-with-ajax-admin.php on line 20

    Any idea how to fix this?
    Thanks for your help
    Alfons

    https://www.ads-software.com/plugins/login-with-ajax/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi Alfons,

    Which version of Login With Ajax, WordPress and PHP are you using?

    Thread Starter Alfo

    (@alfonsberger)

    Hi

    Login with Ajax: 3.1.5
    Wordpress: 4.4.2
    PHP: 7

    I think the issue here is the use of PHP 7. I’ve passed this on to the Dev team.

    Easy fix.

    Class Name constructors are deprecated and need to be replaced through php7 style constructors. Their constructors have the same name, as their class name.

    pre PHP7 style constructor:

    class Foo {
        function Foo(){
            //do stuff
        }
    }

    PHP7 style constructors, though, are named __construct:

    class Foo {
        function __construct(){
            //do stuff
        }
    }
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP Deprecated message’ is closed to new replies.