mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-29 06:26:22 +00:00
581 B
581 B
id | title |
---|---|
f9e3afdc-2d87-4ba2-a9de-758e403bff56 | Switch expression |
Description
Probably a better idea to use match.
Syntax
switch ($this->lexer->lookahead['type']) {
case Lexer::T_SELECT:
$statement = $this->SelectStatement();
break;
case Lexer::T_UPDATE:
$statement = $this->UpdateStatement();
break;
case Lexer::T_DELETE:
$statement = $this->DeleteStatement();
break;
default:
$this->syntaxError('SELECT, UPDATE or DELETE');
break;
}