<?php
//В PHP нет структур
class Setting {
//поле типа
static $mode = 0;
//метод типа
static function setNextMode() {
Setting::$mode = (Setting::$mode + 1) % 3;
}
}
Setting::$mode = 3;
Setting::setNextMode();
//Setting::$mode is 1
echo Setting::$mode;