Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Match expressions may only contain one default arm

Description

match() expression may have one default entry, but no more than that. It is the same than for switch().

Example

<?php

$a = match($b) {
	default => 1;
	default => 2;
}

?>

Alternatives

  • Remove one of the default arm.
  • Remove all the default arms.