Colon¶
Colons are used in a variety of situations :
With named parameters, to separate the name from the value
With labels, for goto
With ternary operator, separated or not from the question mark
The double colon is a distinct operator.
<?php
goto there;
there:
foo(a: 3); //
$b = $a ? 'a' : 'b';
$c = $c ?: 'a';
?>
Related : Goto, Ternary Operator, Coalesce Operator, Coalesce Operator, Named Parameters, Scope Resolution Operator ::