Around lines 160 and 260 of QFormBase.class.php, in the Run() method, the current working form is “globalized”. I really see no need for this, as there can only be one QForm per page and the $_FORM global is used when needed.
But the first strange thing is that it's innecessarily “globalized” twice. Twice when the form is loaded and twice when it's created. I guess it's a double typo.
QFormBase.class.php
<?php
[...]
if ($objClass) {
global $$strFormId;
$$strFormId = $objClass;
$objClass->strCallType = $_POST['Qform__FormCallType'];
$objClass->intFormStatus = QFormBase::FormStatusUnrendered;
if ($objClass->strCallType == QCallType::Ajax)
QApplication::$RequestMode = QRequestMode::Ajax;
// Globalize and Set Variable
global $$strFormId;
$$strFormId = $objClass;
[...]
global $$strFormId;
$$strFormId = $objClass;
// By default, this form is being created NOT via a PostBack
// So there is no CallType
$objClass->strCallType = QCallType::None;
$objClass->strFormId = $strFormId;
$objClass->intFormStatus = QFormBase::FormStatusUnrendered;
$objClass->objControlArray = array();
$objClass->objGroupingArray = array();
// Globalize and Set Variable
global $$strFormId;
$$strFormId = $objClass;
[...]
?>
The second thing is stranger. It seems to me that in the QFormBase::Run() static method all the QForm instance properties are accessed using its “internal” name. In fact it works, but... how are protected instance properties accessed from a static method?