所以我开始处理这个问题已经有2个小时了。我只在CLI中获得Invalid Request (UNEXPECTED EOF)
而无法调试。这是我创建的课程:
$newUserLastID = NULL;
function addNewUser($request, $team) {
global $newUserLastID;
$db = new db();
$db->setErrorCallbackFunction("myErrorHandler", "text");
$status = "1";
$activated = "1";
$randString = generateRandomString();
$hashed = password_hash($randString, PASSWORD_BCRYPT);
$db->insert("accounts", array(
"team" => $team,
"username" => $request,
"nickname" => $request,
"password" => $hashed,
"status" => $status,
//"recruiter" => $recruiterID,
"activation" => $activated,
"textpword" => $randString
));
$newUserLastID = $db->lastInsertId();
return $newUserLastID;
}
当我想获得$newUserLastID
值时,
$somevar = addNewUser('DummyData', 'DummyData2');
代码正在执行但是,我总是在我的CLI中获得Invalid Request (UNEXPECTED EOF)
并停止。您认为我的代码有什么问题?