Why is the triple = needed ? $encoded is always an object and in all cases, FALSE == 'some non null string" is always false.