Ben nads PHP yumruk üzereyim. Ben temelde o kendi bir zihin ile hareket etmektedir inanılmaz basit işlem var.
$this->user = $this->processToken($token);
if(!isset($this->user))
{
$this->sendError(401);
}
Geçerli bir $ simgesi w / bu, bir 401 gönderir ki bu olmamalıdır. Ama bu:
$this->user = $this->processToken($token);
print_r($this->user);
if(!isset($this->user))
{
$this->sendError(401);
}
Şimdi ekranda dışarı basılmış bir dizi var olduğu gerçeği dışında, bir aksama olmadan çalışır. $user
print_r(...)
echo $this->user->name
aynı sonucu (tabii sans dizisi) üreten sahip olan yerine, bir VO olduğunu.
EDIT: I should add, the operation after this returns an incremented int. Which even when the error is sent still increments (as long as the token is correct). So it does look like the header is overriding the end result. I would have thought the if would prevent the header from getting written though?
UPDATE
To make things weirder. If I echo '';
in the same place, it doesn't override anything, and the error still gets displayed.... again, even with good token.