Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
in Plugins by
edited by

Hi everybody

I get this error in the error.log. how it can be resolved?

one of the plugins that are related to this error is warnonleave 

PHP message: PHP Question2Answer more info: Methods with the same name as their class will not be constructors in a future version of PHP; qa_layer_14_from_q2apro_warnonleave_layer_php has a deprecated constructor in eval()'d code from .../qa-plugin/q2apro-warn-on-leave-master/q2apro-warnonleave-layer.php" while reading response header from upstream, client: **.**.**.**, server: www.bidbarg.com, request: "GET /bimeh/46318/%D9%85%D9%82%D8%B1%D8%B1%DB%8C-%D8%A8%DB%8C%D9%85%D9%87-%D8%A8%DB%8C%DA%A9%D8%A7%D8%B1%DB%8C 

Q2A version: 1.7.4

2 Answers

+2 votes
selected by
Best answer
It looks like that was solved a while back. The last change to the plugin from 11 months removes the old style constructor. I just checked on my PHP 7.1 test install, and it works fine.

See https://github.com/q2apro/q2apro-warn-on-leave
Does this work for any q2a version?
+2 votes
If you are using PHP7, replace function name of class constructor from "class name" to "__construct".

Thanks for your answer,

I'm little familiar with PHP. How the "__construct"  should be added to the following line?

    class qa_html_theme_layer extends qa_html_theme_base {