Unexpected :
1. PHP 8 named parameter syntax
unexpected ':', expecting ',' or ')'
If attempting to use PHP 8's new named parameter functionality in a version of PHP < 8 this error will occur:
$table->string(column:'Name');
Solutions:
- Upgrade your version of PHP to PHP 8.80.0 or higher
- Do not use named parameters (pass the parameters in in the order they are expected)
2. Cropped class ::
separator
An error message that begins Parse error: syntax error, unexpected ':' can be caused by mistakenly writing a class static reference Class::$Variable
as Class:$Variable
.