Support » Plugin: SV Gravity Forms Enhancer » Fatal error in PHP 7.1

  • Resolved Chris Van Patten

    (@chrisvanpatten)


    In PHP 7.1, sv-gravity-forms-enhancer triggers a fatal error:

    
    Fatal error: Cannot use lexical variable $widget_class as a parameter name in path/to/plugins/sv-gravity-forms-enhancer/lib/core/widgets/widgets.php on line 128
    
Viewing 1 replies (of 1 total)
  • Looks like this:

    add_action('widgets_init', function ($widget_class) use ($widget_class) {
    	register_widget(get_class($widget_class));
    });
    

    This should be written as

    add_action('widgets_init', function () use ($widget_class) {
    	register_widget(get_class($widget_class));
    });
    
Viewing 1 replies (of 1 total)
  • The topic ‘Fatal error in PHP 7.1’ is closed to new replies.