<?php

/**
 * Garp_Form_Element_Email
 *
 * @package Garp
 * @author Harmen Janssen <harmen@grrr.nl>
 */
class Garp_Form_Element_Email extends Garp_Form_Element_Text {

    public function init() {
        $this->addFilter('PregReplace', array('match' => '/\s+/', 'replace' => ''));
        $this->addValidator('EmailAddress', false);
    }

}

<?php

/**
 * Garp_Form_Element_Email
 *
 * @package Garp
 * @author Harmen Janssen <harmen@grrr.nl>
 */
class Garp_Form_Element_Email extends Garp_Form_Element_Text {

    public function init() {
        $this->addFilter(
            new Zend_Filter_PregReplace([
                'match' => '/\s+/', 'replace' => ''
            ])
        );
        $this->addValidator('EmailAddress', false);
    }

}

Fix error in ReflectionClass when adding filter
Fix error in ReflectionClass when adding filter

Apparently this fails in PHP8 because of how this resolves in a
ReflectioClass? I'm not entirely sure I get this, but this fixes it.
