A
A
alex--n2017-09-19 16:16:55
Yii
alex--n, 2017-09-19 16:16:55

Why does the system react strangely to an object received from json?

Good afternoon.
1. I get Trying to get property of non-object when I try to compare 2. I output before that The system proudly displays
if( $resultJson->Success === false ) {...}
print_r($resultJson);die();

stdClass Object ( [ErrorCode] => [ErrorMessage] => [Success] => true )

I go back to the first step and get Trying to get property of non-object
3. I output The system issues I go back to the first step and get Trying to get property of non-object. 4. Making crutches
print_r($resultJson->Success);die();
true
$temp = $resultJson->Success;
print_r($temp);die();

Returned true.
5. Tried to compare and got Trying to get property of non-object. Has anyone come across this before?
if( $temp === false ) {

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris Korobkov, 2017-09-19
@BorisKorobkov

Telepathy: All this code in a loop. The first element of the loop is good, so die is good. If die is removed, then the first element passes, and the second is null, so it falls.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question