function &createElement($elementType)
    {
        if (!isset($this) || !($this instanceof HTML_QuickForm)) {
            // Several form elements in Moodle core before 3.2 were calling this method
            // statically suppressing PHP notices. This debugging message should notify
            // developers who copied such code and did not test their plugins on PHP 7.1.
            // Example of fixing group form elements can be found in commit
            // https://github.com/moodle/moodle/commit/721e2def56a48fab4f8d3ec7847af5cd03f5ec79
            debugging('Function createElement() can not be called statically, ' .
                    'this will no longer work in PHP 7.1',
                    DEBUG_DEVELOPER);
        }
        $args    =  func_get_args();
        $element = self::_loadElement('createElement', $elementType, array_slice($args, 1));
        return $element;
    }
function &createElement($elementType)
    {
        if (!isset($this) || !($this instanceof HTML_QuickForm)) {
            // Several form elements in Moodle core before 3.2 were calling this method
            // statically suppressing PHP notices. This debugging message should notify
            // developers who copied such code and did not test their plugins on PHP 7.1.
            // Example of fixing group form elements can be found in commit
            // https://github.com/moodle/moodle/commit/721e2def56a48fab4f8d3ec7847af5cd03f5ec79
            debugging('Function createElement() can not be called statically, ' .
                    'this will no longer work in PHP 7.1',
                    DEBUG_DEVELOPER);
        }
        $args    =  func_get_args();
        $element = self::_loadElement('createElement', $elementType, array_slice($args, 1));
        return $element;
    }
function & createElement ( $ elementType ) { if ( ! isset ( $ this ) || ! ( $ this instanceof HTML_QuickForm ) ) { // Several form elements in Moodle core before 3.2 were calling this method // statically suppressing PHP notices. This debugging message should notify // developers who copied such code and did not test their plugins on PHP 7.1. // Example of fixing group form elements can be found in commit // https://github.com/moodle/moodle/commit/721e2def56a48fab4f8d3ec7847af5cd03f5ec79 debugging ( 'Function createElement() can not be called statically, ' . 'this will no longer work in PHP 7.1' , DEBUG_DEVELOPER ) ; } $ args = func_get_args ( ) ; $ element = self :: _loadElement ( 'createElement' , $ elementType , array_slice ( $ args , 1 ) ) ; return $ element ; }
Creates a new form element of the given type.

This method accepts variable number of parameters, their
meaning and count depending on $elementType

@param     string     $elementType    type of element to add (text, textarea, file...)
@since     1.0
@access    public
@return    object extended class of HTML_element
@throws    HTML_QuickForm_Error
Creates a new form element of the given type .