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
- In
include_pathandopen_basedir, double-colon is used as a separator
The double colon is a distinct operator.
<?php
goto there;
there:
foo(a: 3); //
$b = $a ? 'a' : 'b';
$c = $c ?: 'a';
?>