private function assertState($s1, $current) { if (($current & 0xff) !== $s1) { throw new \LogicException("Invalid state nesting at state {$current}"); } }