Using php 5.5.38.
Simple script:
<?php
function a ($a = 'XXX' . 'TTT') {
echo 'Hello ' . $a;
}
a();
This fails with:
PHP Parse error: syntax error, unexpected '.', expecting ')' in line 3
Does php 5.5 not support concatenation in there?
Using php 5.5.38.
Simple script:
<?php
function a ($a = 'XXX' . 'TTT') {
echo 'Hello ' . $a;
}
a();
This fails with:
PHP Parse error: syntax error, unexpected '.', expecting ')' in line 3
Does php 5.5 not support concatenation in there?
This feature was added in PHP 5.6. The same rule applies to class propety declarations.
It is now possible to provide a scalar expression involving numeric and string literals and/or constants in contexts where PHP previously expected a static value, such as constant and property declarations and default function arguments.
See: Constant expressions